xsl-list
[Top] [All Lists]

[xsl] URI Resolver and recoursian

2009-12-29 09:32:21
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')/files"/>
                        </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?

--~------------------------------------------------------------------
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>