Go Back   Velocity Reviews > Newsgroups > XML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

XML - How to retain the namespace xmlns:enc in XML thro XSLT ?

 
Thread Tools Search this Thread
Old 07-18-2006, 07:00 PM   #1
Default How to retain the namespace xmlns:enc in XML thro XSLT ?




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
xmlnsenc namespace is present. I make a call to Java function and
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 xmlnsenc namespace which is
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 xmlnsenc
namespace:::
<XIPMessage version="1.0">
<XIPBody>
<OrderHeader>
<EMasterNumber>11111</EMasterNumber>
<xenc:EncryptedData xmlnsenc="http://www.w3.org/2001/04/xmlenc#
" 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 fuctionOmitting the
xmlnsenc namespace):::
<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"
xmlnssl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:java="http://xml.apache.org/xslt/java"
xmlnsenc="http://www.w3.org/2001/04/xmlenc#"
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
  Reply With Quote
Old 07-19-2006, 12:57 PM   #2
Martin Honnen
 
Posts: n/a
Default Re: How to retain the namespace xmlns:enc in XML thro XSLT ?



Rajesh wrote:


> Original Message which is passing to the XSLT Processor with xmlnsenc
> namespace:::
> <XIPMessage version="1.0">
> <XIPBody>
> <OrderHeader>
> <EMasterNumber>11111</EMasterNumber>
> <xenc:EncryptedData xmlnsenc="http://www.w3.org/2001/04/xmlenc#
> " Type="http://www.w3.org/2001/04/xmlenc#Element">


> Message going from XSLT processor to Java fuctionOmitting the
> xmlnsenc namespace):::
> <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/
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump