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

Re: xsl-list Digest 23 Jun 2007 05:10:01 -0000 Issue 1

Subject: Re: xsl-list Digest 23 Jun 2007 05:10:01 -0000 Issue 1176
From: Mariecon Saberon <yc0n2x@xxxxxxxxx>
Date: Sat, 23 Jun 2007 08:47:43 -0700 (PDT)
 Re: xsl-list Digest 23 Jun 2007 05:10:01 -0000 Issue 1
hi Michael,

thanks for the reply. for added info though, the
second xml with the <addressFieldn> was such because
it came from an input element whose name is
dynamically set. then the "n" or the number after
addressField is an id that i'll be using to reference
that addressField on my database.  

i'm not sure if i explained it right but to give you a
better idea, i'm gonna need to have a form that
dynamically changes the address fields depending on
the country selected. so total address fields will
really vary on what is set for a particular country.
(some has streets+town+postal code, others have
flat+bldg+territory, etc).  

i'll try both your codes and your suggestion on the
xml design still. i'll see if i can get a work around
to arriving at what you suggested. i'll keep you

big thanks!


> ------------------------------
> Date: Fri, 22 Jun 2007 10:20:56 +0100
> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> From: "Michael Kay" <mike@xxxxxxxxxxxx>
> Subject: RE:  Concatenation of Element Values
> Message-ID: <008c01c7b4ae$a3f0b980$6701a8c0@turtle>
> Sorry, the ../* is wrong, it's looking relative to
> ID rather than to
> ADDRESS. The right answer depends on exactly where
> your <addressField1> etc
> elements are.
> Michael Kay
> http://www.saxonica.com/
> > 
> > <xsl:template match="ADDRESS">
> >   <xsl:for-each select="ADDRESSFIELD/ID">
> >     <xsl:value-of
> select="../*[name()=concat('addressField', 
> > current())"/>
> >     <xsl:if test="position()!=last()">;</xsl:if>
> >   </xsl:for-each>
> > </xsl:template>
> > 
> > (I'm assuming here that addressField2, etc, are
> siblings of 
> > ADDRESS, but you didn't make this clear).
> > 
> > Incidentally, coding data into element names like
> this feels 
> > like bad XML design. <addressField id="2"> would
> be much 
> > cleaner than <addressField2>.
> > 
> > Michael Kay
> > http://www.saxonica.com/
> > 

[expletive deleted]-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.

Current Thread


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.
First Name
Last Name
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.