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

RE: Newbie Q: Why are element contents being passed th

Subject: RE: Newbie Q: Why are element contents being passed through?
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Thu, 10 Apr 2003 10:28:10 -0400
RE:  Newbie Q: Why are element contents being passed th
[Elijah Mori]

> I have an xml source doc which I want to turn into an xhtml document 
> with a form, inputs, labels and so forth. What is happening 
> is that the 
> contents of the elements in the xml document are turning up in the 
> output and I can't understand why. I have simplified the xml 
> and the xsl 
> until there is almost nothing happening, and the element 
> contents still 
> come through.
> 

I hope that your xml sample is not what you actually tested, because it
is not well-formed.  Assuming that the missing "</input>' has been
restored, you are seeing the results of the build-in default template
getting applied.  This is happening in the template matching "form".
You have <xsl:apply-templates/> in there, but there are no templates
that match anything.  The processor therefore applies the built-in
template, which just gets the text content of the elements it operates
on.

You canverify this behavior by supplying a template that matches any
element and does nothing:

<xsl:apply-templates match='*'/>

However, this is probably not what you want because you want to process
the child elements of the form.  You probably were thinking of using
xsl:copy-of, but you better not because your input document does not
contain proper html form elements.  You have <input type='select'>...,
bu it is supposed to be a <select .... ...> element instead.  You could
write a template to make this change or you could change the source
format.

Cheers,

Tom P

 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.