Sorry, I gave too minimalist of an example... what I'm actually trying to
do is more like this:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<data>
<field>test</field>
</data>
To edit the field:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="ISO-8859-1"/>
<xsl:template match="/data">
<textarea name="field"><xsl:value-of select="field"/></textarea>
</xsl:template>
</xsl:stylesheet>
I won't get into the details of how this gets written back out to the xml
file, but trust me it does look like the first example in the end.
To display the field:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="ISO-8859-1"/>
<xsl:template match="/data">
<xsl:value-of disable-output-escaping="yes" select="field"/>
</xsl:template>
</xsl:stylesheet>
And accept/restore HTML code in the field. See my last email for more
details about specifically how/why this is failing with Sablotron right
now, and a beginning on a discussion of the solutions.
Dave
At 06:22 PM 7/17/2001 +0200, Petr Cimprich wrote:
>David,
>
>I think your HTML is in mess because you do not use XML/XSLT in a natural way.
>
>Consider the following:
>
><?xml version="1.0" encoding="ISO-8859-1" ?>
><tag>
> <href>test</href>
></tag>
>
>and
>
><?xml version="1.0" encoding="ISO-8859-1" ?>
><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>version="1.0">
><xsl:output method="html" encoding="ISO-8859-1"/>
> <xsl:template match="/tag">
> <a href="{href}"/>
> </xsl:template>
></xsl:stylesheet>
>
>I'm sure you HTML would be just fine. I don't like thinks like
>>test</A>
>if not necessary, but this is nothing but my personal opinion.
>
>Regards,
>Petr
>
>David Burry wrote:
>
> > Hi, I'm relatively new to xslt and even newer to this list, so hope this is
> > the right place...
> >
> > Is there a good reason why this xml:
> >
> > <?xml version="1.0" encoding="ISO-8859-1" ?>
> > <tag>
> > this is a <A HREF="/">test</A>.
> > </tag>
> >
> > plus this xsl:
> >
> > <?xml version="1.0" encoding="ISO-8859-1" ?>
> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> > <xsl:output method="xml" encoding="ISO-8859-1"/>
> > <!-- nothing needed here, since default output is tag contents -->
> > <!-- we could also put a template here that contains one of -->
> > <!-- value-of select="." or value-of select="text()" -->
> > <!-- and we'd get the exact same results -->
> > </xsl:stylesheet>
> >
> > produces this output:
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > this is a <A HREF="/">test</A>.
> >
> > instead of this output:
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > this is a <A HREF="/">test</A>.
> >
> > ?????
> >
> > This kind of behavior is really messing up my HTML, making forms not
> > function (i.e. not submit) in IE because of technically badly formatted
> > default values, etc...
> >
> > Dave
>
>--
>Petr Cimprich
>Ginger Alliance
>www.gingerall.com