473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

<xsl:copy-of > function issue

Hi all,
I am reading xml by xslt. In my xml, some html tags are there.
eg,<tag><td><h1><name>asdas</name></h1></td></tag>
when I use copy-of function it evaluate fine but in html source code
it gives <name>asdas</name>, which is not proper html.

When I use value-of function it gives only value,not evaluating html tags.
how my output will be proper html?
please help..


thanks in advance
Jul 25 '07 #1
2 2223
JosAH
11,448 Expert 8TB
Moved this over from the XML Articles section.

kind regards,

Jos
Aug 5 '07 #2
jkmyoung
2,057 Expert 2GB
eg,<tag><td><h1><name>asdas</name></h1></td></tag>

Try using <xsl:apply-templates/>
Then, only create templates for html tags you want to copy, eg:
Expand|Select|Wrap|Line Numbers
  1. <xsl:template match="html|tr|td|th|h1|b|i|u">
  2.   <xsl:copy>
  3.   <xsl:apply-templates/>
  4.   </xsl:copy>
  5. </xsl:template>
If the template is not found, eg for name, then the apply-templates falls through, and still outputs the text.

Best suggestion I can come up with with what I see so far.
Aug 7 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Tjerk Wolterink | last post by:
Hello, i've an xml doc like this: <doc> <item>a</item> <item>b</item> <item>c</item> <item>d</item> <item>e</item> <item>f</item> <item>g</item>
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.