Re: [xsl] Creating an input form, XML -> XSLT -> HTML

Subject: Re: [xsl] Creating an input form, XML -> XSLT -> HTML
From: Ron King <roncking@xxxxxxxx>
Date: Sun, 30 Dec 2001 11:20:49 -0600
I found an example in the archives dated 17 Oct 1999 23:49:15 from Clark Evans.
The example is supposed to handle attributes as well as elements, but given
this input:

<JobPositionSeeker status = "active">
  <SupplierId idOwner = "">LOR1235</SupplierId>
    <FormattedName type = "presentation">Bob Smith</FormattedName>

It produces this output:




The attributes status, idowner and presentation aren't in the output! How can I
get those too?



Trevor Nash wrote:

> Ron King <roncking@xxxxxxxx> wrote:
> >How can I get a string representing the path in xslt?
> If you look back in the archives of this list you will find references
> to general ways of doing this for any node.  I don't remember where
> exactly.  You will also find it useful to look at the FAQ and
>, among others.
> If the document isn't huge or performance isn't particularly an issue,
> and if its always an element you are after, then a simple approach is
> to generate something of the form "//*[n]" which you can do with:
>  concat('//*[', concat(count(preceeding::*|ancestor-or-self::*), ']')
> (I didn't test that, if it is wrong I am sure someone will correct me
> ;-)
> This is intended as a hint to get you started, not a complete
> solution.
> ><xsl:text disable-output-escaping="yes"> First Name: <![CDATA[<]]>input
> >type="text" name="</xsl:text><xsl:value-of
> >select="generate-id()"/><xsl:text>" value="</xsl:text><xsl:value-of
> >select="GivenName"/><xsl:text disable-output-escaping="yes">"> </xsl:text>
> >
> Others have already pointed out the 'right' way to do this.  If you
> are not sure why your attempt is wrong (other than readability) try
> putting the result of the transformation into a DOM instead of a file.
> You might worry about the / in <input ... /> in the answers you have
> been given, which is not legal HTML.  Don't.  The XSLT processor will
> look after this for you.
> Out of curiosity: how did you arrive at your disable-output-escaping
> solution?  What resources did you use?  Is there a web site out there
> somewhere with examples like this?  A magazine article maybe?
> I know there are others who listen to this list who are also XSLT
> trainers, and may be interested in your answer.
> I hope you have not paid for any XSLT trainng or advice - if you have,
> you were robbed ;-)
> Regards,
> Trevor Nash
> --
> Traditional training & distance learning,
> Consultancy by email
> Melvaig Software Engineering Limited
> voice:     +44 (0) 1445 771 271
> email:     tcn@xxxxxxxxxxxxx
>  XSL-List info and archive:

 XSL-List info and archive:

Current Thread