Subject: [xsl] XML to XML Namespace conversion From: Casper Voortman <casper.voortman@xxxxxxxxxxxx> Date: Mon, 8 Dec 2008 13:14:30 +0100 |
I have a sample XML file that looks something like this: Code: <?xml version="1.0" encoding="UTF-8"?> <Article> <MetaData> <ID>618</ID> <Type>Article</Type> <Name>Article 1 Title</Name> <State>Release</State> <RouteTo>Nobody</RouteTo> <PlacedOn>Layout 1</PlacedOn> <PlacedOnPage>4-6</PlacedOnPage> <Size>116179</Size> <LengthWords>2525</LengthWords> <LengthChars>15892</LengthChars> <LengthLines>287</LengthLines> <Modified>2008-11-24T14:03:54</Modified> <Publication>My Publication</Publication> <Issue>Test Issue</Issue> <Section>Articles</Section> <PublicationId>3</PublicationId> <IssueId>65</IssueId> <SectionId>14</SectionId> <StateId>38</StateId> <LockForOffline>false</LockForOffline> </MetaData> </Article>
The XSLT i tried to write, looks a little like: Code: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:pcv="http://prismstandard.org/namespaces/1.2/pcv/" xmlns:prism="http://prismstandard.org/namespaces/1.2/basic/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<xsl:output method="xml" indent="yes"/> <xsl:strip-space elements="*"/>
<!-- Match 'Article'. --> <xsl:template match="Article"> <!-- Define root element. --> <xsl:element name="rdf:RDF"> <!-- Define description element. --> <xsl:element name="rdf:Description">
<!-- Define indentifier element. --> <xsl:element name="dc:identifier">
<!-- Define format element. --> <xsl:element name="dc:format">
<!-- Define language element. --> <xsl:element name="dc:language">
<!-- Define page range element. --> <xsl:element name="prism:pageRange">
</xsl:element> </xsl:element> </xsl:element> </xsl:template> </xsl:stylesheet>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSLT 2.1: Nestable sequen, Vladimir Nesterovsky | Thread | Re: [xsl] XML to XML Namespace conv, David Carlisle |
Re: [xsl] Problem with < and >, Michael Ludwig | Date | Re: [xsl] XML to XML Namespace conv, David Carlisle |
Month |