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

Processing an xml catalog in xslt

Subject: Processing an xml catalog in xslt
From: Nicolas Mailhot <Nicolas.Mailhot@xxxxxxxxxxx>
Date: Tue, 29 Jun 2004 14:04:09 +0200
xslt catalog
Hi all,

I currently need to feed an xml catalog to a java process that is too
dumb to process it. So I was thinking of extracting the values I need
into a stupid property file using an xsl.

The problem is, I've never processed a file with such a complex
namespace as this xml catalog, and I'm failing miserably. The catalog
file looks like this :

<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog
V1.0//EN"
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
  <public publicId="ISO 8879:1986//ENTITIES Publishing//EN" uri="xml-
dtd-4.2-1.0-24/ent/iso-pub.ent"/>

[...]

<rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.2"
rewritePrefix="xml-dtd-4.2-1.0-24"/>
</catalog>

All I need basically right now is the value of rewritePrefix for this
last entry. The best solution I've found now is

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
  <xsl:output method="text" indent="yes" encoding="UTF-8"/>
  <xsl:strip-space elements="*"/>
 
  <xsl:template match="*
[@uriStartString='http://www.oasis-open.org/docbook/xml/4.2'][1]">
<xsl:value-of select="concat('docbook.dtd.subroot=',@rewritePrefix)"/>
  </xsl:template>
 
</xsl:stylesheet>

But I don't like much to use a * to match rewriteURI. However so far I
didn't manage to replace it with something that still works. Anyone got
a better solution ?

Regards,

-- 
Nicolas Mailhot


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.