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

different versions of xmlns:foo are never usable toge

Subject: different versions of xmlns:foo are never usable together?
From: Brendan Kehoe <brendan@xxxxxxx>
Date: Thu, 14 Jul 2005 16:19:28 +0100
toge recipe
I'm working on a project that's using XML & XSLT to do lots of munging
of files.  I've run into an odd problem that I'm hoping isn't a issue of
who-controls-what.

For example, I've got two files with recipes in them, cake.xml and
muffin.xml.

In cake.xml is
   <food:recipe xmlns:food="http://who/knows/Food/1.0"> ... </food:recipe>

In muffin.xml is
   <food:recipe xmlns:food="http://who/knows/Food/1.1"> ... </food:recipe>

I'd like to use both of them on a style sheet like:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
        xmlns:food="http://who/knows/Food/1.0">
 <xsl:output method="text" encoding="UTF-8"/>
 <xsl:strip-space elements="*"/>
 <xsl:template match="food:recipe">
  <xsl:value-of select="food:name"/>: <xsl:value-of select="food:calories"/>
 </xsl:template>
</xsl:stylesheet>

But the xmlns:food string not being the same makes is selective over
which it's willing to use.

I understand the basic rule that xmlns:food has to be the same to be
honored.  However, this would seem to never allow for backwards
compatibility.  If I want version 2.0 of the 'food' namespace to accept
everything 1.0 did, but also add stuff like <food:wine-suggestions/>, is
it possible?  My stylesheet is interested in some basic bits that're
true of both versions.

I understand that xmlns:food's contents are irrelevant, and that they're
supposed to match.  But this would mean the moment I update my
RecipePrinter app to a newer version which includes some newer recipes,
I have to convert or get rid of all older recipes.

Please tell me I'm missing something. :-)
Thanks,
B
P.S. It'd be cool if I could do
     xmlns:food="http://.../1.0 http://.../2.0"
to cite a union of namespaces I can accept.  But that seems to threaten
to have lots of problems.

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.