Code:
XML file
<i:Details>
<i:Stra>
<stra:Desc>ABC</stra.Desc>
</i:Stra>
</i:Details>
If i use XSL value of
Code:
<xsl:value-of select="i:Details/i:Stra/stra:Desc)"/>
XML file
<i:Details>
<i:Stra>
<stra:Desc>ABC</stra.Desc>
</i:Stra>
</i:Details>
<xsl:value-of select="i:Details/i:Stra/stra:Desc)"/>
XML Generated
-------------
Document genereatedDoc =
<Trade>
<Level>10 </Level>
<Sty> .5 </Sty>
</Trade>
private String sTradeSizeXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
"<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">" + " " +
"xmlns:i=\"http://www.abc.com/common/interests:i\">" +
"<Note>"
private void extractValue(Document configNode)
{
System.out.println("In extract value");
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
NamespaceContext namespace = new NamespaceContextImpl("i:", "http://www.tfs.com/common/interests");
The 'Document' configNode contains the flwg: <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> <i:Interest > <i:Generation>3</i:Generation>
Quantity : <Quantity Value will be entered> Price : <Price will be entered >
Document xmlMessage;
DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
domFactory.setNamespaceAware(true); // never forget this!
DocumentBuilder builder = domFactory.newDocumentBuilder();
<Ext> <Order> <Status>New</Status> </Order> [/Ext>
<xs:element name="Order" type="xs:string" nillable="true"> <xs:annotation>
String szproduct = xpath.evaluate("AQListener/Product/text()", confignode);
System.out.println("szproduct " + szproduct);
Output: EQ.D
<Configuration> <Listener.Whiteboard> <AQListener> <Product>A</Product> <Message.Class>XMLMessage</Message.Class> <Database> <URL></URL> </Database> </AQListener> </Listener.Whiteboard> </Configuration>
<xsl:element name="i:Details"> <xsl:attribute name="xsi.type"> xsl:text>i:vanilla.stock</xsl:text> </xsl:attribute>
//Order/Insrmt
NodeList nodes = (NodeList) result;
<?xml version="1.0" encoding="UTF-8"?> <FIXML xmlns="http://www.fixprotocol.org/FIXML-4-4"> <Order Acct="MAC" Ccy="USD" ComplianceID="C" > <Hdr SeqNum="2" Snt="2007-04-23T08:22:53" /> <PreAll
Leave a comment: