P
Peter Parker
The code works if I remove the namespace, but it's not working with the
namespace. Please help. Thanks.
========
try{
String sXml = "<n1:foo
xmlns:n1='a'><n1:c><b>0</b><b>1</b><b>2</b><b>3</b><b>4</b><b>5</b><b>6</b></n1:c></n1:foo>";
//<= not working if using namespace here
XmlObject sd=XmlObject.Factory.parse(sXml);
XmlCursor sdcursor=sd.newCursor();
sdcursor.toFirstChild();
String xqNamespace ="declare namespace n1='a';";
sdcursor.selectPath( "$this//n1:c"); //not working if using namespace here
while (sdcursor.toNextSelection())
{
System.out.println(sdcursor.getTextValue());
}
catch(XmlException e) {
e.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
namespace. Please help. Thanks.
========
try{
String sXml = "<n1:foo
xmlns:n1='a'><n1:c><b>0</b><b>1</b><b>2</b><b>3</b><b>4</b><b>5</b><b>6</b></n1:c></n1:foo>";
//<= not working if using namespace here
XmlObject sd=XmlObject.Factory.parse(sXml);
XmlCursor sdcursor=sd.newCursor();
sdcursor.toFirstChild();
String xqNamespace ="declare namespace n1='a';";
sdcursor.selectPath( "$this//n1:c"); //not working if using namespace here
while (sdcursor.toNextSelection())
{
System.out.println(sdcursor.getTextValue());
}
catch(XmlException e) {
e.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}