473,507 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
xmlns:xenc 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 xmlns:xenc 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 xmlns:xenc
namespace:::
<XIPMessage version="1.0">
<XIPBody>
<OrderHeader>
<EMasterNumber>11111</EMasterNumber>
<xenc:EncryptedData xmlns:xenc="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 fuction:(Omitting the
xmlns:xenc 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"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:java="http://xml.apache.org/xslt/java"
xmlns:xenc="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>

Jul 18 '06 #1
1 1866


Rajesh wrote:

Original Message which is passing to the XSLT Processor with xmlns:xenc
namespace:::
<XIPMessage version="1.0">
<XIPBody>
<OrderHeader>
<EMasterNumber>11111</EMasterNumber>
<xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#
" Type="http://www.w3.org/2001/04/xmlenc#Element">
Message going from XSLT processor to Java fuction:(Omitting the
xmlns:xenc 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/
Jul 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3251
by: Rolf Kemper | last post by:
Dear Experts, I'm going to create an Excell spreadsheet xml. So far things work very well. But in case I add <Row> elements by a recursive template call it goes wrong. See the attached XSLT...
3
10016
by: Mike Dickens | last post by:
hi, i'm sure this has come up before but havn't managed to find an answer. if i have the following xslt <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet method="xml" version="1.0"...
1
363
by: Wil | last post by:
I'm very new to developing in .NET and even newer to XML. The past few days have been pretty frustrating for me because I'm trying to perform a transform on data in a dataset and it's not working....
1
2517
by: Jack Colletta | last post by:
How can I parse the component elements per partList in the following xml file? If I remove the namespace section of the xml my code works. I am not sure why the namespace section impacts my code?...
1
12583
by: Jack Colletta | last post by:
Hello, If I have a xml document with a rootlevel <workOrderReleased xmlns="http://www.qad.com/qdoc" xmlns:enc="http://www.w3.org/2002/12/soap-encoding"...
2
6804
by: Rick | last post by:
I have an XML document that is generated from Infopath, I need to change the value of a namespace that is defined in a node in the form: <xsf:xDocumentClass "xmlns:my=valuehere">. when i navigate...
0
2780
by: richwangler | last post by:
This problem should be easily reproducable if anybody has the time. I need to build the following XML programatically and decided to use the XMLSerializer. I simplified the XML (myExample.xml)...
0
2115
by: robert | last post by:
Hi all, I'm having a hard time resolving a namespace issue in my wsdl. Here's an element that explains my question, with the full wsdl below: <definitions name="MaragatoService"...
1
1326
by: Viral | last post by:
Hello All, I have the following XML document : (for ease of understanding i am just posting a part of it) Base XML ------------ <?xml version="1.0"?> <ROOT>...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.