Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Convert HTMLSTRINGS from XML to HTML

Status
Not open for further replies.

rytrix

IS-IT--Management
Jan 26, 2009
1
US
I have a large number of xml files that need to be printed out. All I need printed are the "HTMLSTRING" values in HTML format. The xml I'm working with is as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <TEMPLATE CARDTYPE="undefined" HEIGHT="5" WIDTH="7" ORIENTATION="L" MONOGRAM="Y">
- <PANELS>
- <PANEL ARCHIVEIMAGE="CS.Stamp1.jpg" ID="1" EDITABLE="" NAME="FRONT" IMAGE="../assets/personalization/images/WEB.Stamp1_XXL.jpg" SELECTEDLAYOUT="1">
- <LAYOUTS>
- <LAYOUT ID="1" SELECTED="Y" NAME="" THUMBNAILIMAGE="C:/Krishnakumar/Flash/Arun Project/Phase II/Ryan Final/">
<IMAGEAREAS />
- <TEXTAREAS>
<TEXTAREA HEIGHT="0.472" HTMLSTRING="<TEXTFORMAT WIDTH="40" HEIGHT="33" OFFSETX="282" OFFSETY="282" LEADING="5"><P ALIGN="LEFT"><FONT LINE-HEIGHT="27" FACE="CrownRomanHMK" SIZE="18" COLOR="#000000" LETTERSPACING="0" KERNING="0">A</FONT></P></TEXTFORMAT>" ID="FT_1_T_1" PLAINSTRING="" VISIBLEINUI="Y" WIDTH="0.569" XPOS="03.93" YPOS="1.181" />
<TEXTAREA HEIGHT="0.472" HTMLSTRING="<TEXTFORMAT WIDTH="164" HEIGHT="33" OFFSETX="282" OFFSETY="282" LEADING="5"><P ALIGN="LEFT"><FONT LINE-HEIGHT="27" FACE="CrownRomanHMK" SIZE="18" COLOR="#000000" LETTERSPACING="0" KERNING="0">Abbott</FONT></P></TEXTFORMAT>" ID="FT_1_T_2" PLAINSTRING="" VISIBLEINUI="Y" WIDTH="2.289" XPOS="03.93" YPOS="2" />
<TEXTAREA HEIGHT="1.913" HTMLSTRING="<TEXTFORMAT WIDTH="202" HEIGHT="137" OFFSETX="282" OFFSETY="282" LEADING="5"><P ALIGN="LEFT"><FONT LINE-HEIGHT="27" FACE="CrownRomanHMK" SIZE="18" COLOR="#000000" LETTERSPACING="0" KERNING="0">PO Box 456</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="5"><P ALIGN="LEFT"><FONT LINE-HEIGHT="27" FACE="CrownRomanHMK" SIZE="18" COLOR="#000000" LETTERSPACING="0" KERNING="0">Garden City, Missouri</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="5"><P ALIGN="LEFT"><FONT LINE-HEIGHT="27" FACE="CrownRomanHMK" SIZE="18" COLOR="#000000" LETTERSPACING="0" KERNING="0">64747</FONT></P></TEXTFORMAT>" ID="FT_1_T_3" PLAINSTRING="" VISIBLEINUI="Y" WIDTH="2.808" XPOS="03.93" YPOS="2.861" />
</TEXTAREAS>
</LAYOUT>
</LAYOUTS>
</PANEL>
</PANELS>
</TEMPLATE>

I have a program that says it can convert xml to html, but I need a working xsl template. If anybody is able to help a paypal donation may be in order.
 
You can do it like this. (I put every htmlstring output inside a div for delineation. You have to decide where to put in your actual requirement.)
[tt]
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="[ignore][/ignore]">
<xsl:eek:utput method="html" omit-xml-declaration="yes" indent="yes" />
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="TEMPLATE" />
</body>
</html>
</xsl:template>
<xsl:template match="TEMPLATE">
<xsl:for-each select=".//TEXTAREA">
<div>
<xsl:value-of select="@HTMLSTRING" disable-output-escaping="yes" />
</div>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
[/tt]
ps: >If anybody is able to help a paypal donation may be in order.
Look up the link where you can donate to the tek-tips site instead if the above helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top