X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Futil%2Fxml%2FEXIParameters.java;h=593b77f193e8cd38aca8ca5fbea5b9606bd11c9e;hb=b23703bef6c3aaafe2dc83608a03b738ad42f945;hp=2c8a16cbe1db93b57cef255bdec5e0eb774eb7d2;hpb=7451e256fd9a658db243666bc7e734204519ceee;p=controller.git diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/EXIParameters.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/EXIParameters.java index 2c8a16cbe1..593b77f193 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/EXIParameters.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/xml/EXIParameters.java @@ -7,6 +7,7 @@ */ package org.opendaylight.controller.netconf.util.xml; +import org.opendaylight.controller.netconf.api.NetconfMessage; import org.openexi.proc.common.AlignmentType; import org.openexi.proc.common.EXIOptions; import org.openexi.proc.common.EXIOptionsException; @@ -38,7 +39,11 @@ public final class EXIParameters { this.options = Preconditions.checkNotNull(options); } - public static EXIParameters forXmlElement(final XmlElement root) throws EXIOptionsException { + public static EXIParameters fromNetconfMessage(final NetconfMessage root) throws EXIOptionsException { + return fromXmlElement(XmlElement.fromDomDocument(root.getDocument())); + } + + public static EXIParameters fromXmlElement(final XmlElement root) throws EXIOptionsException { final EXIOptions options = new EXIOptions(); options.setAlignmentType(AlignmentType.bitPacked); @@ -73,24 +78,25 @@ public final class EXIParameters { } if (root.getElementsByTagName(EXI_PARAMETER_SCHEMA).getLength() > 0) { +/* + GrammarFactory grammarFactory = GrammarFactory.newInstance(); + if (operationElement + .getElementsByTagName(EXI_PARAMETER_SCHEMA_NONE) + .getLength() > 0) { + this.grammars = grammarFactory.createSchemaLessGrammars(); + } + + if (operationElement.getElementsByTagName( + EXI_PARAMETER_SCHEMA_BUILT_IN).getLength() > 0) { + this.grammars = grammarFactory.createXSDTypesOnlyGrammars(); + } - // GrammarFactory grammarFactory = GrammarFactory.newInstance(); - // if (operationElement - // .getElementsByTagName(EXI_PARAMETER_SCHEMA_NONE) - // .getLength() > 0) { - // this.grammars = grammarFactory.createSchemaLessGrammars(); - // } - // - // if (operationElement.getElementsByTagName( - // EXI_PARAMETER_SCHEMA_BUILT_IN).getLength() > 0) { - // this.grammars = grammarFactory.createXSDTypesOnlyGrammars(); - // } - // - // if (operationElement.getElementsByTagName( - // EXI_PARAMETER_SCHEMA_BASE_1_1).getLength() > 0) { - // this.grammars = grammarFactory - // .createGrammars(NETCONF_XSD_LOCATION); - // } + if (operationElement.getElementsByTagName( + EXI_PARAMETER_SCHEMA_BASE_1_1).getLength() > 0) { + this.grammars = grammarFactory + .createGrammars(NETCONF_XSD_LOCATION); + } +*/ }