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

multiple documents, namespaces and the same structure

Subject: multiple documents, namespaces and the same structure
From: Dan Vint <dvint@xxxxxxxx>
Date: Wed, 10 Jan 2001 10:18:14 -0800 (PST)
street address structure
I have an application that is made up of several small documents that each 
have a DTD and their own namespace assignments. These documents all work 
together and are linked via an attribute (href) that has the name of the
document file.

Within several of these I have a common address structure. Currently,
I process each document and address structure vi document() and then use
something like commercial:street or alob:street to format these documents.

What I want to do is create a standard template that I could pass the whole
address structure into and have it format everything. I beleive I'm being hung 
up on the namespace names. If I take a simple version of the template it would
be like this:

Here is the call:

<xsl:for-each select="//commercial:business/commercial:us.address">
	<xsl:call-template name="format.address">
		<xsl:with-param name="address.node" select="."/>
	</xsl:call-template>
</xsl:for-each>

the template:

<xsl:template name="format.address">
<xsl:param name="address.node"/>
	<xsl:value-of select="$address.node"/>
	<xsl:value-of select="$address.node/@address.type"/>
	<xsl:value-of select="$address.node/street"/>
</xsl:template>

Data looks like:

	 <us.address address.type="street"> 
		<street>222 Kearney St.</street> 
		<street>Suite 500</street> 
		<city>San Francisco</city> 
		<state>CA</state><zip main="94108" sub="1234"/> 
	 </us.address> 

This template will output:

222 Kearney St.Suite 500San FranciscoCA
street 
<<nothing here for the third item>>

Any idea on how to set this up? I have other templates that I use generically 
but I pass in specific values so I don't have the same problem. I suppose I 
could do that here, but that would require changing every call to this template
if a new attribute or element is added to address - workable but not pretty.

thanks
..dan


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.