[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Dividing a long document into seperate documents
Finally, it works.
You have been great help~~~ Appreciated, Cheers, Ryan easierFrom: "Jay Bryant" <jay@xxxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: Re: Dividing a long document into seperate documents Date: Wed, 16 Aug 2006 13:07:31 -0500 to understand if it follows the template path.but > not in this xslt. Have no idea why... > > Any idea?? > > Here is my xslt... and my xml files.. Any suggestion??? > > XSLT: > <xsl:stylesheet version="2.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > xmlns:dc="http://purl.org/dc/elements/1.1/" > xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" > > > <xsl:output encoding="UTF-8" method="xml" indent="yes" /> > > <xsl:template match="uiuc"> > <xsl:for-each select="metadata/oai_dc:dc"> > <xsl:result-document href="{concat('rdf', > count(preceding-sibling::oai_dc:dc) +1, '.rdf')}"> > > <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" > xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > xmlns:dc="http://purl.org/dc/elements/1.1/" > xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"> > > <xsl:variable name="identifier"> > <xsl:value-of select="normalize-space(dc:identifier)"/> > </xsl:variable> > <rdf:Description> > <xsl:attribute name="rdf:about"><xsl:value-of > select="$identifier"/></xsl:attribute> > <rdf:type rdf:resource="http://purl.org/gem/qualifiers/GEM2"/> > <xsl:apply-templates select="dc:identifier"/> > <xsl:apply-templates select="dc:title"/> > <xsl:apply-templates select="dc:creator"/> > <xsl:apply-templates select="dc:subject"/> > <xsl:apply-templates select="dc:format"/> > <xsl:apply-templates select="dc:description"/> > <xsl:apply-templates select="dc:publisher"/> > <xsl:apply-templates select="dc:date"/> > <xsl:apply-templates select="dc:type"/> > <xsl:apply-templates select="dc:contributor"/> > <xsl:apply-templates select="dc:coverage"/> > <xsl:apply-templates select="dc:rights"/> > <xsl:apply-templates select="dc:language"/> > <xsl:apply-templates select="dc:relation"/> > <xsl:apply-templates select="dc:source"/> > </rdf:Description> > </rdf:RDF> </xsl:result-document></xsl:for-each> > </xsl:template> > > <xsl:template match="dc:identifier"> > <dc:identifier rdf:resource="{normalize-space(.)}"/> > </xsl:template> > > <xsl:template match="dc:title"> > <dc:title> > <xsl:value-of select="normalize-space(.)"/> > </dc:title> > </xsl:template> > > <xsl:template match="dc:creator"> > <dc:creator> > <xsl:value-of select="normalize-space(.)"/> > </dc:creator> > </xsl:template> > > <xsl:template match="dc:subject"> > <dc:subject> > <xsl:value-of select="normalize-space(.)"/> > </dc:subject> > </xsl:template> > > <xsl:template match="dc:format"> > <dc:format> > <xsl:value-of select="normalize-space(.)"/> > </dc:format> > </xsl:template> > > <xsl:template match="dc:description"> > <dc:description> > <xsl:value-of select="normalize-space(.)"/> > </dc:description> > </xsl:template> > > <xsl:template match="dc:publisher"> > <dc:publisher> > <xsl:value-of select="normalize-space(.)"/> > </dc:publisher> > </xsl:template> > > <xsl:template match="dc:date"> > <dc:date> > <xsl:value-of select="normalize-space(.)"/> > </dc:date> > </xsl:template> > > <xsl:template match="dc:type"> > <dc:type> > <xsl:value-of select="normalize-space(.)"/> > </dc:type> > </xsl:template> > > <xsl:template match="dc:contributor"> > <dc:contributor> > <xsl:value-of select="normalize-space(.)"/> > </dc:contributor> > </xsl:template> > > <xsl:template match="dc:coverage"> > <dc:coverage> > <xsl:value-of select="normalize-space(.)"/> > </dc:coverage> > </xsl:template> > > <xsl:template match="dc:language"> > <dc:language> > <xsl:value-of select="normalize-space(.)"/> > </dc:language> > </xsl:template> > > <xsl:template match="dc:rights"> > <dc:rights> > <xsl:value-of select="normalize-space(.)"/> > </dc:rights> > </xsl:template> > > <xsl:template match="dc:relation"> > <dc:relation> > <xsl:value-of select="normalize-space(.)"/> > </dc:relation> > </xsl:template> > > <xsl:template match="dc:source"> > <dc:source> > <xsl:value-of select="normalize-space(.)"/> > </dc:source> > </xsl:template> > > </xsl:stylesheet> > > > My xml file: > > <?xml-stylesheet type="text/xsl" href="uiuc_item.xsl"?> > <uiuc> > <metadata> > <oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" > xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ > http://www.openarchives.org/OAI/2.0/oai_dc.xsd"> > <dc:title>Oldtown Folks</dc:title> > <dc:creator>Stowe, Harriet Beecher, 1811-1896</dc:creator> > <dc:subject>New England -- Social life and customs -- Fiction.</dc:subject> > <dc:subject>Women -- New England -- Fiction.</dc:subject> > <dc:subject>PS2954 .O4</dc:subject> > <dc:identifier>http://digital.library.upenn.edu/women/stowe/folks/folks.html </dc:identifier>Me.).</dc:subject> > <dc:subject>Thaxter, Celia, 1835-1894.</dc:subject>travel.</dc:subject> > <dc:subject>SB466 .U6 T5</dc:subject> > <dc:identifier>http://digital.library.upenn.edu/women/thaxter/garden/garden. html</dc:identifier>the > >preceding-sibling axis. As it happens, the metadata elements have noRDF > >elements as preceding siblings, so it never gets anywhere. If you're > trying > >to create an RDF file for each metadata/oai_dc:dc element, then count > those > >elements, thus: > > > ><xsl:for-each select="metadata/oai_dc:dc"> > > <xsl:result-document href="{concat('rdf', > >count(preceding-sibling::oai_dc:dc) +1, '.rdf')}"> > > <!-- Snipped the other processing --> > > </xsl:result-document> > ></xsl:for-each> > > > >HTH > > > >Jay Bryant > >Bryant Communication Services > > > > _________________________________________________________________ > MSN Messenger8& EkGX ?B6s@N;s?! @V4B D#18?M 4kH-8& 3*4)<<?d. > http://messenger.msn.co.kr _________________________________________________________________ @|<<0h@N@L GT22GO4B @% 8^@O <-:q=:@N MSN Hotmail@; 883* :8<<?d. http://loginnet.passport.com/login.srf?id=2&svc=mail&cbid=24325&msppjph=1&lc=1042
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|