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

Re: no input from document()?

Subject: Re: no input from document()?
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Sun, 22 Feb 2004 16:22:39 -0000
joe xsl
----- Original Message ----- 
From: "davidpbrown" <lists@xxxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Sunday, February 22, 2004 4:10 PM
Subject:  no input from document()?


> This may be simple but having battled for a few hours now, I'm stumped and
> not learning anything new.
> Several searches on Google have me thinking it should be working but also
> suggest problems existed with processors document() functions. I don't
know
> now if it's me or the processors I'm using.
>
> The document() below is leaving $B blank.. I've tried both Xalan and Saxon
> 7, and a whole host of variations but every time $B is empty.
>
> It's intent (eventually) is to compare an opml rss feed list with a master
> file
> opml files containing outlines in the form
> <outline type="rss" title="x" description=""
> xmlUrl=http://www.example.com/feed.rss htmlUrl="http://www.example.com/"/>
>
> ?
> Thanks in advance
> davidpbrown
> -------
> <?xml version="1.0"?>
> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:output method="xml" indent='yes' encoding="utf-8"/>
>
>   <xsl:variable name="A" select="/" />
>   <xsl:variable name="B" select="document('master_file.xml')//outline"/>
>
>   <xsl:template match="/">
>   <!-- Process all outline nodes in A: -->
>    <xsl:for-each select="//outline">
>     <xsl:apply-templates select="." mode="A" />
>    </xsl:for-each>
>   </xsl:template>
>
>   <xsl:template match="//outline" mode="A">
>   <!-- Figure out whether this A feed is matched in B,
>                            and output an appropriate message. -->
>    <xsl:variable name="feed" select="@xmlUrl" />
>    <xsl:variable name="matching" select="$B[@xmlUrl = $feed]" />
>    <xsl:text>
> </xsl:text>
>
>    <xsl:if test="string($matching) != string($feed)">
>     <xsl:copy-of select="."/>
>    </xsl:if>
>   </xsl:template>
>
> </xsl:transform>
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>
Although I'm no expert, especially on Xalan or Saxon specifically,  it seems
like there could be two things wrong, either the file is not being found,
perhaps a relative address without the file:// prefix isn't enough, secondly
the document's outline elements are in a namespace declared higher up, what
does the document element look like?.

Good luck

-- 

Joe

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.