[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Temporary tree elements and namespaces

Subject: Re: Temporary tree elements and namespaces
From: "Sam Byland" <shbyland@xxxxxxxxxxx>
Date: Wed, 13 Feb 2008 16:57:14 -0500
Re:  Temporary tree elements and namespaces
Joco,

to specify a default namespace in XSLT 2, you use the "xpath-default-namespace" attribute. However, I don't fully understand your question:

After some wasted hours I've figured out that the
problem is the default namespace that Excel *requires* to be present.

Requires to be present in the output XML file? i.e you indicate you are "converting" an XML document to an Excel XML file; is your XSLT intending to do this conversion, or have you done a conversion manually and your XSLT below is intended to transform the converted (Excel) XML file?


The XSLT you provided does not output XML, but text; so I'm thinking that the "real" XML source you are having to use has some namespace issues making your code not work. If so, perhaps you could provide an input example where such namespaces are used?

=== XML FILE ===

<?xml version="1.0" encoding="ISO-8859-1"?>
<values>
  <value>0.123</value>
  <value>0.234</value>
</values>

In your "final version", are the values and value elements in some particular namespace that we don't see in this example?


I'm going to assume that is the case. For the following XML file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<values xmlns="some.Excel.default.namespace">
<value>0.123</value>
<value>0.234</value>
</values>

Your original XSLT file will work with just a few slight mods:

-- change your xsl:stylesheet line to something like this:

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:foo="some.Excel.default.namespace">

-- then add foo: in a couple places:

<xsl:template match="/foo:values"> <-- here

<xsl:for-each select="foo:value"> <-- and here

Does that help?

...sam

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.