xsl-list
[Top] [All Lists]

[xsl] DTD and Collection

2009-08-28 02:13:20
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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>