[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Using XSL to create HTML page from values of attributes in X
Hi I am using IE 5.0 as my XSL processor. I have a scenario where I have to use XSL to generate an HTML page using the content and the HTML tags specified in an XML document. Basically, the content and how to display the content, (for eg, bold or italicized or <H1> </H1> or <H4> </H4>) are present in the XML document as eithe nodes or attributes. Let me give you an example: example.xml <?xml version="1.0"?> <?xml-stylesheet href="example.xsl" type="text/xsl"?> <Name id="3270" NameBeginTag="<H1>" NameEndTag="</H1>"> <Child>Joe</Child> <Child>Pete</Child> </Name> example.xsl <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> <xsl:template match="/"> <HTML> <head> </head> <BODY> <xsl:for-each select="Name/Child"> <xsl:value-of select="//Name/@NameBeginTag"/> <xsl:value-of select="."/> <xsl:value-of select="//Name/@NameEndTag"/> </xsl:for-each> </BODY> </HTML> </xsl:template> </xsl:stylesheet> This xsl results in a page that looks like this in the browser. Basically the tags are printed literally on the HTML page.. "<H1> Joe </H1> <H1> Pete </H1> " I understand what is happening, since the NameBeginTag attribute in the Name node has the tags literally (<.... >....), the xsl also prints it literally.. Could someone please tell me how I can work around this ? In my XML document I canNOT put the tags <H1> </H1> in the node attributes, as neither attributes nor nodes can contain < , > symbols. Later.. Badari XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|