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

DTD and Collection

Subject: DTD and Collection
From: Ganesh Babu N <nbabuganesh@xxxxxxxxx>
Date: Fri, 28 Aug 2009 11:42:53 +0530
 DTD and Collection
Dear all,

I am having 10 XML files in a directory called "D:/cover/mambio" as follows:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book-review PUBLIC "-//ES//DTD journal article DTD version
5.1.0//EN//XML" "art510.dtd" []>
<book-review docsubtype="brv" xml:lang='en'>
	<item-info>
		<jid>MAMBIO</jid>
		<aid>40200</aid>
		<ce:pii>S1616-5047(07)00201-7</ce:pii>
		<ce:doi>10.1016/j.mambio.2007.11.013</ce:doi>
		<ce:copyright type="society" year="2007">Deutsche Gesellschaft
f&uuml;r S&auml;ugetierkunde</ce:copyright>
	</item-info>
</book-review>

I am using collection function to display <aid> value from each file.
(This is simple step of a bigger project)

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ce="http://www.elsevier.com/xml/common/dtd"	xmlns:sb="http://www.elsevier.com/xml/common/struct-bib/dtd"	xmlns:tb="http://www.elsevier.com/xml/common/table/dtd"	xmlns:mml="http://www.w3.org/1998/Math/MathML"	xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.elsevier.com/xml/ja/dtd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="ce sb tb xlink mml saxon xs f"	version="2.0">
	<xsl:output method="xml"/>
	<xsl:template name="main">
	     <xsl:for-each
select="collection('file:///D:/cover/MAMBIO?select=*.xml;recurse=yes;on-error=warning')">
	           <xsl:value-of select="document-uri(.)"/>
                   <xsl:value-of select="./book-review/item-info/aid"/>
	      </xsl:for-each>
	</xsl:template>
</xsl:stylesheet>

i am using catalogs to resolve the DTD.

Here is the command i am using for processing.

java -cp "C:\Program Files\java\saxon9.jar;C:\Program
Files\java\xercesImpl.jar;C:\Program
Files\java\xml-apis.jar;C:\Program Files\java\resolver.jar"
-Dxml.catalog.files="E:\programs\samples-macparser\cat1.xml"
net.sf.saxon.Transform -x
org.apache.xml.resolver.tools.ResolvingXMLReader -y
org.apache.xml.resolver.tools.ResolvingXMLReader -r
org.apache.xml.resolver.tools.CatalogResolver -it:main -xsl:test.xsl

I am getting only files names displayed. I am not getting the <aid>
values. Even after adding the ce namespace also only filename is
coming. When i remove DOCTYPE and add namespace then i am getting
<aid> value.

Please suggest how to get <aid> with DOCTYPE.

Regards,
Ganesh

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.