Subject: Re: [xsl] Help moving away from named templates From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Wed, 02 May 2007 18:52:56 +0200 |
Thank you David and Abel for your patience and thank you for formulating (for me!) what part of my question actually is.
You're right. There are structural differences between the customer XML and the customer's contacts XML. I apologize for being imprecise. Let's give a simplistic version of the two:
Customer.xml <Records> <Record> <id>6</id> <firstName>Steve</firstName> </Record> </Records>
eContacts.xml <Records> <Record> <custID>6</custID> <firstName>Mommy</firstName> <relationship>Mother</relationship> </Record> </Records>
That'd be, on the selecting part: <xsl:apply-templates select="Record[id]" />
and <xsl:apply-templates select="Record[custID]" />
or <xsl:template match="Record[custID]" >....
<xsl:template match="Record" > <error>Unmatched record found!</error> <xsl:template>
Obviously, distinguishing between these two in XPath is not really difficult.
But let's say there are 10 or 15 other pages about
Customers which need to be displayed, each with some nuanced
difference.
I suppose I feared ending up with a tangled mess of
templates which are potentially trying to chomp each other's input due
to similarities.
Cheers, -- Abel
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Help moving away from nam, Steve | Thread | Re: [xsl] Help moving away from nam, David Carlisle |
RE: [xsl] XSL History, Michael Kay | Date | RE: [xsl] Help moving away from nam, Michael Kay |
Month |