![]() |
|
|
|||||||
![]() |
XML - How to retain the namespace xmlns:enc in XML thro XSLT ? |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
I am trying to pass the namespace, which is in my Original Message, to a Java method for further processing. In the original message the xmlns pass the whole XML message along with tags and values. In my Java function when I tried to print the XML message which is receieved by the XSLT proc. it has omitted the xmlns creating a problem in Java function for further processing. How can I instruct the XSLT processor not to omit any of the namespaces which is in the Original Namespaces so that Java fucntion will receive the fully qualified XML message? Original Message which is passing to the XSLT Processor with xmlns namespace::: <XIPMessage version="1.0"> <XIPBody> <OrderHeader> <EMasterNumber>11111</EMasterNumber> <xenc:EncryptedData xmlns " Type="http://www.w3.org/2001/04/xmlenc#Element"> <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/> <ds:KeyInfo> <xenc:EncryptedKey> <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/> <xenc:CipherData> <xenc:CipherValue>KA1ia0wKl3KfCS</xenc:CipherValue> </xenc:CipherData> </xenc:EncryptedKey> </ds:KeyInfo> <xenc:CipherData> <xenc:CipherValue>aKN68CYqMqXa+</xenc:CipherValue> </xenc:CipherData> </xenc:EncryptedData> <PONumber>101012</PONumber> </OrderHeader> </XIPBody> </XIPMessage> Message going from XSLT processor to Java fuction xmlns <XIPMessage version="1.0"> <XIPBody> <OrderHeader> <EMasterNumber>11111</EMasterNumber> <xenc:EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"> <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes128-cbc"/> <ds:KeyInfo> <xenc:EncryptedKey> <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/> <xenc:CipherData> <xenc:CipherValue>KA1ia0wKl3KfCS</xenc:CipherValue> </xenc:CipherData> </xenc:EncryptedKey> </ds:KeyInfo> <xenc:CipherData> <xenc:CipherValue>aKN68CYqMqXa+</xenc:CipherValue> </xenc:CipherData> </xenc:EncryptedData> <PONumber>101012</PONumber> </OrderHeader> </XIPBody> </XIPMessage> XSL: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:java="http://xml.apache.org/xslt/java" xmlns xmlns:decrypter="com.xerox.xip.x509.Decrypter"> <xsl:template match="/"> <xsl:apply-templates select="decrypter:decryptXMLNode(.)"/> - Calling Java Mehod which does decryption of message </xsl:template> ....... ....... ....further validations only on elements of XML... </xsl:stylesheet> Rajesh |
|
|
|
|
#2 |
|
Posts: n/a
|
Rajesh wrote: > Original Message which is passing to the XSLT Processor with xmlns > namespace::: > <XIPMessage version="1.0"> > <XIPBody> > <OrderHeader> > <EMasterNumber>11111</EMasterNumber> > <xenc:EncryptedData xmlns > " Type="http://www.w3.org/2001/04/xmlenc#Element"> > Message going from XSLT processor to Java fuction > xmlns > <XIPMessage version="1.0"> > <XIPBody> > <OrderHeader> > <EMasterNumber>11111</EMasterNumber> > <xenc:EncryptedData > Type="http://www.w3.org/2001/04/xmlenc#Element"> > <xsl:template match="/"> > <xsl:apply-templates select="decrypter:decryptXMLNode(.)"/> - Calling The processor passes a node set to that decryptXMLNode function and not any serialized markup. If that function does not properly serialize the nodes then I don't think that is an XSLT problem. You will have to ask the author of decryptXMLNode or at least anyone familiar with the working of that function if it does not produce the result you want. -- Martin Honnen http://JavaScript.FAQTs.com/ |
|