This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > July 2006 > XML and XSLT





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author XML and XSLT
johnpeter887@hotmail.com

2006-07-10, 11:06 pm

How can i write a xsl to get all the text in SAMPLE tags and also the
tags under the SAMPLE tag like(underline, bold, tag1, tag2)


<?xml version="1.0" encoding="utf-8" ?>
<CASE id="1">
<NAME>test</NAME>
<SAMPLE TID="1">This <underline>is</underline> some
<BOLD>text</BOLD></SAMPLE>
<SAMPLE TID="3">This <underline>is</underline> some <TAG1>more</TAG1>
more<BOLD>text</BOLD></SAMPLE>
<SAMPLE TID="3">This <underline>is</underline> some <TAG2>more</TAG2>
more more<BOLD>text</BOLD></SAMPLE>
</CASE>

Dimitre Novatchev

2006-07-10, 11:06 pm

Read about, understand well and use the xsl:copy-of instruction

Cheers,
Dimitre Novatchev

<johnpeter887@hotmail.com> wrote in message
news:1152576811.973373.146210@m79g2000cwm.googlegroups.com...
> How can i write a xsl to get all the text in SAMPLE tags and also the
> tags under the SAMPLE tag like(underline, bold, tag1, tag2)
>
>
> <?xml version="1.0" encoding="utf-8" ?>
> <CASE id="1">
> <NAME>test</NAME>
> <SAMPLE TID="1">This <underline>is</underline> some
> <BOLD>text</BOLD></SAMPLE>
> <SAMPLE TID="3">This <underline>is</underline> some <TAG1>more</TAG1>
> more<BOLD>text</BOLD></SAMPLE>
> <SAMPLE TID="3">This <underline>is</underline> some <TAG2>more</TAG2>
> more more<BOLD>text</BOLD></SAMPLE>
> </CASE>
>



John

2006-07-13, 7:13 pm

No, Actually i am looking for an output like this from the XML file. I
want to find tags like underline, bold, tag1.....and replace them with
<u>, <b>, <i>......

Final output
This <u>is</u> some<b>text</b>
This <u>is</u> some <i>more</i>more<b>text</b>
This <u>is</u> some <TAG2>more</TAG2>more more<b>text</b>

How can i do this?


Dimitre Novatchev wrote:[color=darkred]
> Read about, understand well and use the xsl:copy-of instruction
>
> Cheers,
> Dimitre Novatchev
>
> <johnpeter887@hotmail.com> wrote in message
> news:1152576811.973373.146210@m79g2000cwm.googlegroups.com...

Alexander Schneider

2006-07-13, 7:13 pm

Sounds like you will use XSLT. Look around tempalate-tags
Im also not a prof. but it must be something like

<template match='block'>
<b>.</b>
</template>

<template match='underline'>
<u>.</u>
</template>

and so on.

start such a tempalte with
<apply-template xxx='*'/>

Here you will find more inforamtion
http://www.zvon.org/xxl/XSLTreference/Output/index.html

good luck

Alexander
"John" wrote:

> No, Actually i am looking for an output like this from the XML file. I
> want to find tags like underline, bold, tag1.....and replace them with
> <u>, <b>, <i>......
>
> Final output
> This <u>is</u> some<b>text</b>
> This <u>is</u> some <i>more</i>more<b>text</b>
> This <u>is</u> some <TAG2>more</TAG2>more more<b>text</b>
>
> How can i do this?
>
>
> Dimitre Novatchev wrote:
>
>

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews