Thank you in advance for any help you can provide.
I have an XML document provided to me, here's a snippet:
<?xml version="1.0" standalone="no"?>
<web-export>
<?whitespace-handling use-characters?>
<run-date>02/10/2011
<pub-code>UNG VP
<ad-type>CLS 6 Col Tab
<cat-code>Liner</cat-code>
<class-code>100</class-cod
e>
<subclass-code>143</subcla
ss-code>
<position-description>Noti
ces</posit
ion-descri
ption>
<ad-number>0000146752-01</
ad-number>
<start-date>02/10/2011</st
art-date>
<end-date>02/10/2011</end-
date>
<line-count>6</line-count>
<run-count>1</run-count>
<customer-type>Transient</
customer-t
ype>
<account-number>151915</ac
count-numb
er>
<account-name>OREGON WCP STATEWIDE CLASS</account-name>
<addr-1>133 ENTERPRISE DRIVE </addr-1>
<addr-2> </addr-2>
<city>VERONA</city>
<state>WI</state>
<postal-code>53593</postal
-code>
<country>USA</country>
<phone-number>6081111111</
phone-numb
er>
<fax-number></fax-number>
<url-addr></url-addr>
<email-addr></email-addr>
<pay-flag>N</pay-flag>
<ad-description>ATTENTIOND
IABETICSWI
THMEDICARE
GETAFREETA
</ad-descr
iption>
<order-source></order-sour
ce>
<order-status>Ready</order
-status>
<payor-acct>151915</payor-
acct>
<agency-flag>N</agency-fla
g>
<rate-note></rate-note>
<ad-content>
<b>ATTENTION DIABETICS </b>with Medicare. Get a FREE Talking Meter and diabetic supplies at NO COST plus FREE home delivery! Best of all, this meter eliminates painful finger pricking! Call 1-888-667-5202 (wcan)</ad-content>
</ad-type>
I need to pull the data out of it that I need (not all) and apply formatting. I also don't want any repeating heads. I have accomplished this much with XSL.
What I can't get is the bold tag, within the ad-content tag to show up in the output.
Here is the XSL:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="
http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<!--Container Element -->
<xsl:element name="ad-type">
<!--Start loooping through XML data -->
<xsl:for-each select="web-export/run-dat
e/pub-code
/ad-type">
<!--Set up elements. Do not ouput subclass-code and position-description dups-->
<subclass-code>
<xsl:value-of select='concat(subclass-co
de[not(.=p
receding::
subclass-c
ode)], " ", position-description[not(.
=preceding
::position
-descripti
on)])'/>
</subclass-code>
<!--Carriage Return -->
<xsl:text> </xsl:text>
<!--Add ad content -->
<ad-content><xsl:value-of select="ad-content"/>
</ad-content>
<!--Carriage Return -->
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
replace this
<ad-content><xsl:value-of select="ad-content"/>
</ad-content>
by this
<xsl:copy-of select="ad-content"/>
value of will only show the text nodes
copy-of will make a deep copy