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

PyXslt or XSLT transforming to PYX...

Subject: PyXslt or XSLT transforming to PYX...
From: Eric van der Vlist <vdv@xxxxxxxxxxxx>
Date: Thu, 23 Mar 2000 21:08:06 +0100
pyxslt
Hi,

Pyxie is often opposed to XSLT, but they can also be complementary and
XSLT can generate PYX...

This simple XSLT transformation :

------------------------------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="text"/>

<xsl:template match="text()"><xsl:if test="normalize-space()">
-<xsl:value-of select="normalize-space()"/></xsl:if></xsl:template>

<xsl:template match="*">
(<xsl:value-of select="name()"/><xsl:apply-templates
select="*|@*|text()"/>
)</xsl:template>

<xsl:template match="@*">
A<xsl:value-of select="concat(name(),' ',.)"/>
</xsl:template>

</xsl:stylesheet>
------------------------------

applied on Sean's XML example :

------------------------------
<Person>
<Surname>McGrath</Surname>
<Given>Sean</Given>
<e-mail type="internet">sean@xxxxxxxxxxxx</e-mail>
</Person>
------------------------------

gives :

------------------------------
(Person
(Surname
-McGrath
)
(Given
-Sean
)
(e-mail
Atype internet
-sean@xxxxxxxxxxxx
)
)
------------------------------

The white spaces and other special characters such as \n are not are not
preserved and neither the PI nor the namespaces are handled, but I think
it's already tasting like PYX...

Don't you think so ?

Eric 
-- 
------------------------------------------------------------------------
Eric van der Vlist                                             Dyomedea
http://xmlfr.org         http://ducotede.com        http://dyomedea.com
------------------------------------------------------------------------


 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.