Posted: Tue Oct 12, 2010 1:25 am Post subject: Get SchemaLocation using JAVACompute Node
Acolyte
Joined: 30 Oct 2008 Posts: 62
Hi, buddies
I have a XML file as below:
<Message xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./test.xsd">
<tag1>111</Tag1>
</Message>
I'm trying to get schema file name "./test.xsd" using JAVACompute node, but failed.
MbXPath xp = new MbXPath("/Message/@xsi:noNamespaceSchemaLocation");
xp.addNamespacePrefix("xsi", "http://www.w3.org/2001/XMLSchema-instance");
List nodeset = (List)inMessage.getRootElement().getLastChild().evaluateXPath(xp);
MbElement el = (MbElement)nodeset.get(0);
String fileName = el.getValueAsString();
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum