> The answer is no in the general case. Consider for instance <test>
> <a>a</a>
> <b>b</b>
> </test>
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:template match="/">
> result from which you cannot get the initial XML document
> </xsl:template>
> </xsl:stylesheet>
>
> But you can get some information about the document and its
> content if you look inside the stylesheet and to the result.
>
> If in this case we will have for instance the stylesheet as
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:template match="/">
> [<xsl:value-of select="test/a"/>]
> [<xsl:value-of select="test/b"/>]
> </xsl:template>
> </xsl:stylesheet>
>
> and the output:
>
> [a]
> [b]
>
> Then you can infere that the initial document has test as
> root element and at least two children a and b with content
> "a" and "b" respectivelly.
Well if you are going to do that you may as well do:
<xsl:template match="/">
<xsl:copy-of select="."/>
</xsl:template>
But I think the poster was hoping that you could somehow reverse
engineer the output of a transform with the stylesheet, and obtain some
sort of input xml - which of course, you can't.
Cheers
andrew
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
- RE:
- Rowland Shaw - Wed, 7 Jan 2004 04:38:07 -0500 (EST)
- <Possible follow-ups>
- Ragulf Pickaxe - Wed, 7 Jan 2004 04:56:00 -0500 (EST)
- Ragulf Pickaxe - Wed, 7 Jan 2004 05:49:37 -0500 (EST)
- Andrew Welch - Wed, 7 Jan 2004 05:56:20 -0500 (EST) <=
- Andrew Welch - Wed, 7 Jan 2004 05:59:18 -0500 (EST)
- Gary Calvin - Wed, 7 Jan 2004 14:14:00 -0500 (EST)
- Peter_Ivan - Thu, 8 Jan 2004 03:52:39 -0500 (EST)
|
|