0

i have the xml that looks like

<?xml version="1.0" encoding="UTF-8"?>
<pnode>
 <mdsC:adf-mds-config xmlns="http://xmlns.oracle.com/adf/mds/config">
    <mds-config xmlns="http://xmlns.oracle.com/mds/config">
      <persistence-config>
        <metadata-namespaces>
          <namespace path="/soa/shared" metadata-store-usage="mstore-usage_1"/>
 </metadata-namespaces>
 </persistence-config>
</mds-config>
  </mdsC:adf-mds-config>
</pnode>

i was trying to print metadata-namespaces children as follows:

def destXml = new XmlSlurper(false,false).parse("above xml file")
println "${groovy.xml.XmlUtil.serialize(destXml.'adf-mds-config'.'mds-config'.'persistence-config'.'metadata-namespaces')}"

but it throws exception like:

[Fatal Error] :2:1: Premature end of file.
ERROR:  'Premature end of file.'
Caught: groovy.lang.GroovyRuntimeException: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 1; Premature end of file.
groovy.lang.GroovyRuntimeException: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 1; Premature end of file.
    at mergeAdfConfig$_run_closure6.doCall(mergeAdfConfig.groovy:143)
    at mergeAdfConfig$_run_closure6.doCall(mergeAdfConfig.groovy)
    at mergeAdfConfig$_run_closure7.doCall(mergeAdfConfig.groovy:205)
    at mergeAdfConfig.run(mergeAdfConfig.groovy:190)

to my observation the prefix mdsC: is causing the issue. but not sure why and how to handle this

Vik
  • 8,721
  • 27
  • 83
  • 168

1 Answers1

-1

Looks like you're missing a proper namespace specification. Change "xmlns" to "xmlns:mdsC" in the "mdsC:adf-mds-config" element. Don't change the other one.

David M. Karr
  • 14,317
  • 20
  • 94
  • 199