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

RE: unresolved problem using html

Subject: RE: unresolved problem using html
From: "bryan" <bry@xxxxxxxxxx>
Date: Wed, 15 May 2002 15:29:54 +0200
sending parameter xsl href tags
[
>>>See the document() function for including additional XML documents.
>>>
>>Unfortunately I've got to include an HTML document  :-( , document is 
>>only reserved to xml
>>
>
>can the html document be a well-formed xml document?
>If not can the html document be an xml document with everything below
>the document element in a CDATA section?
]
longjohn wrote:
>Unfortunately I don't understand what you mean about well-formed
>Consider that HTML could be something like :

><a href="http://www.polito.it" class="norm" target="_top">Politecnico
di 
>Torino</a> <br />
><a href="http://www.polito.it/dipartim/autoinfo/itindex.html" 
>class="norm" target="_top">Dipartimento di Automatica e Informatica</a>
><br /> Corso Duca degli Abruzzi 24 <br />Torino , Italy

>and consider also that I can manipulate it before sending it to xsl 
>because I call the string from a JSP page (of course I can't transform 
>it  into pure XML because the string could contain many kinds of HTML 
>tags! So I can add something as head or tale of the string)
       


okay I don't see anything above that would break an xml parser, unless
of course there wasn't a document element for this(in which case I think
any html parser would break too) 
that said here's some possibilities:
send in the html as a parameter to your xslt. 

<root>
<a href="http://www.polito.it" class="norm" target="_top">Politecnico di

Torino</a> <br />
<a href="http://www.polito.it/dipartim/autoinfo/itindex.html" 
class="norm" target="_top">Dipartimento di Automatica e Informatica</a>
<br /> Corso Duca degli Abruzzi 24 <br />Torino , Italy
</root>

if the parameter was named htmlinclude

then you would have this in your xslt

<xsl:param name="htmlinclude"/>

<xsl:template match="/">
<xsl:copy-of select="$htmlinclude"/>
</xsl:template>

in this way you don't even have to use a node-set function cause the
root tag will be ignored by the browser.

?possibility 2

have a tag in your xml 
<include href="myhtml.xml"/>

then you make <xsl:param name="myhtml" select="document(@href)"/>
<xsl:copy-of select="$myhtml/root/*"/>


 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.