Ignoring xmlns namespaces in the input xml file

Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2006
Posts: 22
Reputation: hanifa is an unknown quantity at this point 
Solved Threads: 0
hanifa hanifa is offline Offline
Newbie Poster

Ignoring xmlns namespaces in the input xml file

 
0
  #1
Feb 8th, 2007
Hi guys,
Here is my snippet of input xml file..
[HTML]<Root xmlns="http://www.wfmc.org/2002/XPDL1.0" xmlns:xpdl="http://www.wfmc.org/2002/XPDL1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Id="wrkflw6" Name="wrkflw6" xsi:schemaLocation="http://www.wfmc.org....xsd">[/HTML]

Currently, I am not sure how I can modify the my standard xslt to completely ignore all this attributes.I do also realise that ignoring these attributes is not good idea. But the case is that I simply dont need them at all.

How do I change this to incorporate the above said.
[HTML]<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>[/HTML]


Thanks for Ur help...

Cheers
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: Ignoring xmlns namespaces in the input xml file

 
0
  #2
Feb 11th, 2007
that bit of XSLT will still match to the root node; regardless of its namespace. I'd put:

  1. <xsl:template match="/">
  2. <xsl:apply-templates select="*"/>
  3. </xsl:template>

or do some processing within that block..; without a select or name on the <apply-templates/> node, I think that's an illegal instruction.

If you have undeclared namespaces; some XSLT processors will fail. If you take those xmlns attributes out; then any 'xsi' or 'xpdl' nodes in your document will be illegal...
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 22
Reputation: hanifa is an unknown quantity at this point 
Solved Threads: 0
hanifa hanifa is offline Offline
Newbie Poster

Re: Ignoring xmlns namespaces in the input xml file

 
0
  #3
Feb 12th, 2007
Actually the truth is when i remove all the
[html]<Root xmlns="http://www.wfmc.org/2002/XPDL1.0" xmlns:xpdl="http://www.wfmc.org/2002/XPDL1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Id="wrkflw6" Name="wrkflw6"
xsi:schemaLocation="http://www.wfmc.org....xsd">[/html]
and change it to this...my output is perfect.
[html]
<Root>[/html]
So I clearly reckon, that I am definetly not using these xpdl,xsi and schemaLocation namespaces...

What I do wanna know is that, does a chnge in XSL file sufficient or the does the change has to be made to the XML engine...???
Cos one of guys in the chat forums told me to change the XMLreader file(in dotNet) but I am using Pyana. So wat is the best option now.

All help appreciated...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC