Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 

Go Back   XSL - XML - RSS Forums > XML General > MS Office and XML

Tags:



Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-02-2008, 11:04 PM
Peter Flynn
 
Posts: n/a

Default Different namespaces in versions of Word



I have just started accepting some Word documents which have a different
namespace value for "w" and "v" from those documents I have used before.

I'd rather not try to maintain two parallel XSLT files. I tried creating
a "driver" XSLT for each set of namespaces, which then xsl:include'd my
original XSLT file (shorn of all except the required xsl namespace), but
this seems to have the effect of ignoring the namespaces declared in the
driver, so Saxon complains of an Undeclared namespace prefix.

testa.xml
---------
<?xml version="1.0"?>
<element xmlns:a="foo" xmlns:b="bar" a:value="blort" b:name="test"/>


testa.xsl
---------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:a="foo" xmlns:b="bar" version="1.0">

<xsl:include href="test.xsl"/>

</xsl:stylesheet>


test.xsl
--------
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xslutput method="text"/>

<xsl:template match="element">
<xsl:value-of select="@a:value"/>
<xsl:text>:</xsl:text>
<xsl:value-of select="@b:name"/>
<xsl:text>&#xa;</xsl:text>
</xsl:template>

</xsl:stylesheet>


Is there a way to do this right?

///Peter
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On



Contact Us -|- XSL - XML - RSS Forums -|- Archive -|- Top -|-Rules/Disclaimer-|-Help/Support -|-Advertise
© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
All times are GMT. The time now is 12:58 PM.
Style Developed by Epic Designz