How does XSLT utilize prefixed attributes from a separate so
Posted: Thu Mar 26, 2015 6:07 am
I take an XML file and transform it to a fixed width utilizing XSLT, yet I'm forced to use attributes of a certain prefix. For the transformation to function properly I have to upload my finished XSLT file to a website, run it, and the website produces the necessary fixed width file.
What I want to know is how can I perform the same transformation without uploading the XSLT?
What kind of file (Schema, XSL) must I produce and link, to make sense of these attributes?
For example:
XSLT:
Notice the 'joe' prefixed attributes, what do I do to make sense of them without having to upload the XSLT and have the server do it for me? I'd prefer to do the work in a separate file versus adding variables/functions to the same note_XSL.xsl stylesheet.
I appreciate your input, thanks.
What I want to know is how can I perform the same transformation without uploading the XSLT?
What kind of file (Schema, XSL) must I produce and link, to make sense of these attributes?
For example:
Code: Select all
<!-- note_XML.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
Code: Select all
<!-- note_XSL.xsl -->
<?xml version-"1.0" encoding="UTF-8"?>
<xsl:stylesheet smlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result prefixes="xs"
xmlns:joe="urn:com.website/joe" version="2.0">
<xsl:template match="/">
<Case joe:separator="
">
<Tape>
<PersonReceiving joe:fixedLength="4">
<xsl:value-of select="/note/to"/>
</PersonReceiving>
<Sender joe:fixedLength="4" joe:align="right">
<xsl:value-of select="/note/from"/>
</Sender>
etc...
</Tape>
</Case>
</xsl:template>
<xsl:stylesheet>
I appreciate your input, thanks.