473,473 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Default Namespace Error.No element displayed.

56 New Member
I have an Input XML document which has a default namspace.
This document is generated by a 3rd party system.

Expand|Select|Wrap|Line Numbers
  1. <FIXML xmlns="http://www.fixprotocol.org/FIXML-4-4">
  2.     <Order Acct="1" ExDest="ExchDest">
  3.         <Hdr Snt="2007-04-05T13:34:47"/>
  4.         <Instrmt Issr="Barclays" MMY="200903"/>
  5.     </Order>
  6. </FIXML>
  7.  
Now,if I use this namespace in my XSL style sheet,
no element gets displayed.

Expand|Select|Wrap|Line Numbers
  1.  
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
  3. xmlns="http://www.fixprotocol.org/FIXML-4-4" >
  4. <xsl:output method="xml"/>
  5.  
  6. <xsl:template match="FIXML">
  7. <xsl:apply-templates  select ="Order"/>
  8. </xsl:template>
  9.  
  10. <xsl:template match="Order">
  11. <NewSingleOrder>
  12.  
  13. <ID>
  14. <xsl:value-of select="@Acct"/> 
  15. </ID>
  16. </NewSingleOrder>
  17.  
  18.  
As the input XML is generated dynamically and given to me,I cannot
delete this from the Input XML.

How can I solve this ?

I am unable to delete the default namspace from the input XML document
Apr 17 '07 #1
3 1390
dorinbogdan
839 Recognized Expert Contributor
Could you make a copy of that XML that will contain same data without the namespace attribute?
If manually not, then by code.
If load the XML in a DOM object, you might alter directly the DOM object before passing to XSL (then no copy would be necessary).
Apr 17 '07 #2
luthriaajay
56 New Member
The XML input document is dynamically being given the associated XSL
by using transform

Expand|Select|Wrap|Line Numbers
  1. ByteArrayOutputStream out = new ByteArrayOutputStream();
  2. transformer.transform(new DOMSource(singleOrder),new StreamResult(out));
  3.  
  4. where singleOrder is the Input Document and 'out' acts as a holder of
  5. the transformation.
  6.  
  7.  
Apr 17 '07 #3
luthriaajay
56 New Member
I have solved this issue.
Thanks,
Apr 17 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a...
3
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"...
5
by: Adam Child | last post by:
Hi All, I'm trying to validate an xml document. I'm having trouble setting the default namespace of the xml document. If I hard encode the namespace in the xml file then everything works fine....
6
by: Martin | last post by:
Hi, I have a xml file like the one below <?xml version="1.0" encoding="utf-8"?><e1 xmlns:e1="http://tempuri.org/Source1.xsd" e1:att1="1" e1:att2="2" e1:rest="345"/> If I try to create a...
5
by: David Thielen | last post by:
Hi; I set up my xml as follows: XmlDocument xml = new XmlDocument(); xml.Load(File.Open("data.xml", FileMode.Open, FileAccess.Read)); XmlNamespaceManager context = new...
12
by: Plop69 | last post by:
need some help on following: xml file 1 <TEST xmlns="http://test" > <OK>mlkddflmkj</OK> </TEST>
2
by: Mark | last post by:
Hi... I've been trying the .Validate() method on the XmlDocument to validate some xml against a schema, but one thing I noted was that unless the document explicitly declares the schema as a...
7
by: Bilal | last post by:
Hello all, I came across this problem while working out the bugs in my identity trasnformation stylesheets but sidestepped it for later to see if there is an easier/better solution. This is...
9
by: Mark Olbert | last post by:
I'm trying to serialize (using XmlSerializer.Serialize) a class that I generated from an XSD schema using XSD.EXE /c. The problem I'm running into is that the root element needs to be unqualified,...
0
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
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...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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
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
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
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
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 ...
0
muto222
php
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.