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

URI Resolver and recoursian

Subject: URI Resolver and recoursian
From: Brian Newman <brian.newman@xxxxxxxxxxx>
Date: Tue, 29 Dec 2009 09:31:53 -0500
 URI Resolver and recoursian
I'm beating my head against this problem and need some more
help, please.

My stylesheet looks like

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:sched="schedule"
xmlns:zip="zipfiles">
	<!--<xsl:include href="Retina_Policy.xsl"/>
	<xsl:include href="PGD_Policy.xsl"/>
	<xsl:include href="Oracle SRR Policy.xsl"/>-->
	<xsl:template match="/">
		<xsl:result-document method="xml" href="error_brian.xml">
			<root>
				<xsl:apply-templates
select="document('sql://BNEWMAN__MSSQLSERVER2008/scheduler/policy/next')/file
s"/>
			</root>
		</xsl:result-document>
	</xsl:template>
	<xsl:template match="files">
		<xsl:apply-templates select="file"/>
	</xsl:template>
	<xsl:template match="file">
		<status>
			<xsl:attribute name="filepath"><xsl:value-of
select="@loc"/></xsl:attribute>
			<xsl:choose>
				<xsl:when test="unparsed-text-available(@loc)">
					<type>Unparsed Text</type>
					<!--<xsl:call-template name="UnparsedText"><xsl:with-param
name="datapath" select="@loc"/></xsl:call-template>-->
				</xsl:when>
				<xsl:when test="doc-available(@loc)">
					<details>
						<xsl:attribute name="type">Parsed Text</xsl:attribute>
						<parts>
							<xsl:apply-templates select="document(@loc)/node()"/>
						</parts>
					</details>
				</xsl:when>
				<xsl:otherwise>
					<xsl:attribute name="error">File does not exist<xsl:value-of
select="@loc"/></xsl:attribute>
				</xsl:otherwise>
			</xsl:choose>
		</status>
	</xsl:template>
	<xsl:template match="node()"/>
</xsl:stylesheet>

Now, as you can see, I'm making a call to a SQL server and it returns XML
which has a set of <file> elements which have a @loc which, as you can guess
is the path to a file.
I run a doc-available() on that @loc and, if it is a zip file, I resolve it to
XML containing the files within that zip as well as their sizes.  The XML
returned by the zip resolver looks something like

<?xml version="1.0" encoding="utf-8"?>
<files>
<file size="109645824" loc="jar
file://C:/path/to/data.zip!mydata_AugustCD09.mdb" />
<file size="83890176" loc="jar
file://C:/path/to/data.zip!mydata_September09CD.mdb" />
files>

Up to here, everything works fine

MY PROBLEM

Once I get the XML returned from the zip resolver, I recourse back to calling
doc-available and document() on the @loc values of this XML and pass that
value back to my URI Resolver.
When I pass that last step to my URI Resolver, the value I'm getting sent to
the URI Resolver is

{file://{path to stylesheet}/jar
file://C:/path/to/data.zip!mydata_AugustCD09.mdb}

What I'm expecting to get is

{jar file://C:/path/to/data.zip!mydata_AugustCD09.mdb}

Can someone please help me understand why?

Can someone please help me understand why?

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.