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

Questions about Xalan

Subject: Questions about Xalan
From: "Peter B. West" <pbwest@xxxxxxxxxxxx>
Date: Fri, 09 Jun 2000 12:37:32 +1000
dummy dtd
Dear list,

I have some queries about XSLT, specifically as processed in Xalan.  I
am, as you will gather, new to this, and I am finding it a wee bit
difficult.

1) I have found that including a default namespace declaration in the
DTD of an xml file results in nothing being recognized.  If I remove the
declaration from the DTD, but leave it in the xml, processing proceeds
smoothly.

In the FAQ, there is a comment about the equivalence of default and
prefixed namespaces (where the definition is identical), and that seems
to imply that I should define a prefixed namespace in the xsl, which
will then match on the defaulted Qnames (is that right?) in the xml and
DTD.  I haven't tried this.  Is it corect, and if so, why does the
default not work?

2) I am processing two xml documents in a single .xsl.  I access the
second through a document() function.  This is the first document:

<?xml version="1.0" encoding="iso-8859-1"?>

<!DOCTYPE dummy SYSTEM "dummy.dtd" [
]>

<dummy>
  <a name="aname">
    <b name="bname">
      <c name="cname">
	This is the c text
      </c>
    </b>
  </a>
</dummy>


This is the second, called x.xml

<?xml version="1.0" encoding="iso-8859-1"?>

<!DOCTYPE dummy SYSTEM "dummy.dtd" [
]>

<dummy>
  <x name="xname">
    <y name="yname">
      <z name="zname">
	This is the z text
      </z>
    </y>
  </x>
</dummy>

In the xsl file, I set up a variable with the document call like so:

  <xsl:variable name="xdoc" select=
		"document('x.xml#xpointer(id($zname))')"/>

I invoke this with:
    <xsl:apply-templates select="$xdoc" mode="xmode"/>


The zname variable has been set up like so:
  <xsl:variable name="zname">zname</xsl:variable>  (a)

Leaving aside the fact that Xalan does not seem to process XPointer
fragments successfully, this combination works when the time comes to
access x.xml.  However, if I define the zname variable like this:
  <xsl:variable name="zname" select= "zname"/>      (b)
it doesn't work.

On the other hand, if I define it like this:
  <xsl:variable name="zname" select= "string('zname')"/>   (c)
it works again.

Does the select with a Qname immediately try to find and return a
node-set, whereas the string function forces the type of the select?  Is
the result tree fragment of method (a) automatically interpreted as a
string?

If I define the xdoc variable using a result tree fragment, as in:
  <xsl:variable name =
		"xdoc">document('x.xml#xpointer(id("zname"))')</xsl:variable>
then when I invoke as above, it fails.  If I set some debugging, I get:
XPATH: Can not convert #UNKNOWN to a NodeList!

Can anyone clarify these things for me?

Yours faithfully,
Peter
-- 
 __ /__   Peter B. West  pbwest@xxxxxxxxxxxx
   /     http://www.powerup.com.au/~pbwest
  /     "Lord, to whom shall we go?"


 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.