473,804 Members | 2,959 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:Encrypted Data xmlns:xenc="htt p://www.w3.org/2001/04/xmlenc#
" Type="http://www.w3.org/2001/04/xmlenc#Element" >
<xenc:Encryptio nMethod
Algorithm="http ://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
<ds:KeyInfo>
<xenc:Encrypted Key>
<xenc:Encryptio nMethod
Algorithm="http ://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
<xenc:CipherDat a>
<xenc:CipherVal ue>KA1ia0wKl3Kf CS</xenc:CipherValu e>
</xenc:CipherData >
</xenc:EncryptedK ey>
</ds:KeyInfo>
<xenc:CipherDat a>
<xenc:CipherVal ue>aKN68CYqMqXa +</xenc:CipherValu e>
</xenc:CipherData >
</xenc:EncryptedD ata>
<PONumber>10101 2</PONumber>
</OrderHeader>
</XIPBody>
</XIPMessage>

Message going from XSLT processor to Java fuction:(Omitti ng the
xmlns:xenc namespace):::
<XIPMessage version="1.0">
<XIPBody>
<OrderHeader>
<EMasterNumber> 11111</EMasterNumber>
<xenc:Encrypted Data
Type="http://www.w3.org/2001/04/xmlenc#Element" >
<xenc:Encryptio nMethod
Algorithm="http ://www.w3.org/2001/04/xmlenc#aes128-cbc"/>
<ds:KeyInfo>
<xenc:Encrypted Key>
<xenc:Encryptio nMethod
Algorithm="http ://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
<xenc:CipherDat a>
<xenc:CipherVal ue>KA1ia0wKl3Kf CS</xenc:CipherValu e>
</xenc:CipherData >
</xenc:EncryptedK ey>
</ds:KeyInfo>
<xenc:CipherDat a>
<xenc:CipherVal ue>aKN68CYqMqXa +</xenc:CipherValu e>
</xenc:CipherData >
</xenc:EncryptedD ata>
<PONumber>10101 2</PONumber>
</OrderHeader>
</XIPBody>
</XIPMessage>

XSL:
<?xml version="1.0"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:java="htt p://xml.apache.org/xslt/java"
xmlns:xenc="htt p://www.w3.org/2001/04/xmlenc#"
xmlns:decrypter ="com.xerox.xip .x509.Decrypter ">

<xsl:template match="/">
<xsl:apply-templates select="decrypt er:decryptXMLNo de(.)"/- Calling
Java Mehod which does decryption of message
</xsl:template>
.......
.......
....further validations only on elements of XML...
</xsl:stylesheet>

Jul 18 '06 #1
1 1883


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:Encrypted Data xmlns:xenc="htt p://www.w3.org/2001/04/xmlenc#
" Type="http://www.w3.org/2001/04/xmlenc#Element" >
Message going from XSLT processor to Java fuction:(Omitti ng the
xmlns:xenc namespace):::
<XIPMessage version="1.0">
<XIPBody>
<OrderHeader>
<EMasterNumber> 11111</EMasterNumber>
<xenc:Encrypted Data
Type="http://www.w3.org/2001/04/xmlenc#Element" >
<xsl:template match="/">
<xsl:apply-templates select="decrypt er:decryptXMLNo de(.)"/- 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
3282
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 and the result. Last 30 lines of the xslt may be the most interesting ones. I'm processing it with XMLSPY. Regardless of the xslt processor (ALTOVA / MSXML4 ) I get the same result.
3
10043
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" xmlns:ns1="abc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" media-type="text/xml" standalone="yes" version="1.0"/> <xsl:template match="/">
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. Basically, all of the data is stored in an Access .mdb that is read into a dataset when the application is loaded. There are some minor changes to the schema between what is in the physical database to accomodate some things that Access just...
1
2530
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? Of course when I remove the namespace I section I change the selectnode reference accordingly. <?xml version="1.0"?> <workOrderReleased xmlns="http://www.qad.com/qdoc" xmlns:enc="http://www.w3.org/2002/12/soap-encoding"...
1
12897
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" xmlns:qcom="http://www.qad.com/qdoc/common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="workOrderReleasedWithComments-JITS17_1.xsd">
2
6857
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 to the namespace value it is read only and cannot be changed. Can anyone tell me how to change this value? My Code: Dim sSingleNode As XmlNode = objDoc.SelectSingleNode("//xsf:Node", NamespaceManager)
0
2804
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) that i need to create for this post. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"...
0
2147
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" targetNamespace="http://swaMaragatoNS" xmlns:tns="http://swaMaragatoNS" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
1
1346
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> <REPLY>DRAWLIST_INFO_REQUEST</REPLY>
0
9704
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9571
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7608
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6845
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
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 we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.