[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: copy-of / value-of

Subject: Re: copy-of / value-of
From: Jan Theofel <theofel@xxxxxxx>
Date: Mon, 02 Sep 2002 16:43:04 +0200
xslt copy of value of
Hello,

Michael Kay schrieb:
> 
> > Program used: Saxon 5.6.2 (latest stable)
> I guess you mean 6.5.2...

Correct. Just a typo.

> > In my XML for that, I want to be able to add a tag <special> like:
> >
> > <special>
> >   Some text here as line 1<br/>
> >   Some text here as line 2
> > </special>
> >
> > But when I use this with value-of, the result is:
> >
> > Some text here as line 1 Some text here as line 2
> > (without the tag in the middle.)
> >
> > I also tried copy-of which is better, but copies also the XML tags.
> >
> > All I want to do is to be able to add a tag to my XML file
> > which may include HTML tags. How can I do this?
> >
> 
> I don't understand: you seem to be making a distinction between "XML
> tags" and "HTML tags" in your XML file. How are they distinguished?

Well, my english is not so good, so I try again another explaination of my
problem:

I want to create three different HTML file using XML/XSLT. They have the same
content but very different layouts (one "normal", one for PDA and one for
printing). The XML file is a file programm.xml
(http://www.etes.de/files/programm.xml):

--- snip ---
<?xml version="1.0"  encoding="ISO-8859-1"?>

<programm>
  <zeitraum>September - Oktober 2002</zeitraum>
  <veranstaltungen>

    <termin>
      <datum>Sa, 14.9.</datum>
      <url>http://www.deutsches-museum.de/</url>
      <titel>Besuch des Deutschen Museums in München</titel>
      <starttext>ganztätig</starttext>
      <zusatztext>
        mit von Kepler-SeminaristInnen geleiteten Führungen in der Abteilung
Pharmazie<br/>
        Teilnahme nur nach Rücksprache und Anmeldung
      </zusatztext>
    </termin>

    <termin>
      ...
    </termin>
    ...
  </veranstaltungen>
</programm>
--- snap ---

You can see the <zusatztext> tag here (tag names are German - soory :-). It
contains a tag <br> which should appear in the final HTML code. The XSLT file
for conversion is for example programm-html.xsl.
(http://www.etes.de/files/programm-html.xsl;  It produces a part of an HTML
file which is included in a bigger template.)

--- snip ---
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="html" encoding="ISO-8859-1" />
  <xsl:template match="/">

<CENTER>

<P><FONT size="+2">Kepler-Seminar für Naturwissenschaften</FONT></P>
[...]

<xsl:for-each select="programm/veranstaltungen/termin">
[...]
  <xsl:if test="zusatztext">
    <xsl:value-of select="zusatztext" /><BR />
  </xsl:if>
[...]
</xsl:for-each>

</CENTER>

</xsl:template>
</xsl:stylesheet>
--- snap ---

Here you can see the usage of thex "zusatztext".

The problem with the example above is that I get here for value-of as shown
above:

        mit von Kepler-SeminaristInnen geleiteten Führungen in der Abteilung
Pharmazie
        Teilnahme nur nach Rücksprache und Anmeldung

and not the wanted:
 
        mit von Kepler-SeminaristInnen geleiteten Führungen in der Abteilung
Pharmazie<br>
        Teilnahme nur nach Rücksprache und Anmeldung

> Can you give an example of the input and output of your transformation.

URLs:
  http://www.etes.de/files/programm.xml
  http://www.etes.de/files/programm-html.xsl


Perhaps a way to get a solution:
How would I have to write down special characters like < in the XML code
above?


Thanks,
Jan

-- 
Jan Theofel                              Fon: +49 (7 11) 48 90 83 - 0 
ETES - EDV-Systemhaus GbR                Fax: +49 (7 11) 48 90 83 - 50 
Libanonstrasse 58 A * D-70184 Stuttgart  Web: http://www.etes.de

______________________________________
Inflex - eMail Scanning and Protection
Queries to: postmaster@xxxxxxx

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.