You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stuart Roebuck <st...@adolos.co.uk> on 2001/02/19 14:22:54 UTC

[C2] well-formedness of XML document() references

Having moved onto the most recent version of C2 I notice that my XSLT document() references to XML files are not working anymore.  I was previously using a C2 CVS version from a few months ago.

I have some XSP which generates an XML document, let's call it "test/doc.xml" (e.g. context = "test").

    <map:match pattern="doc.xml">
        <map:generate type="serverpages" src="doc.xsp" />
        <map:serialize type="xml" />
    </map:match>

I then have a bit of XSLT that will convert an XML document into an HTML document showing the actual XML document content syntax highlighted:

    <map:match pattern="*.source">
        <map:generate src="http://localhost:8080/test/{1}" />
        <map:transform src="look/general/serialize_xml.xslt" />
        <map:serialize />
    </map:match>

So a request for page "http://localhost:8080/test/doc.xml.source" correctly allows me to view the XML document "doc.xml" in my browser (which doesn't have the facility built in).

Now, to the problem.

I have another XSLT document "testing.xslt" which refers to some content in the XML document like this (line 28):

        <META name="dc.date" content="{document('http://localhost:8080/test/doc.xml')//current_date/@date}" />

This used to work fine, but now results in the following onscreen error (it doesn't appear in the log it appears in the terminal output of tomcat):

	file:/Users/stuart/webapp/test/testing.xslt; Line 28; Column 122; Can not load requested doc: The root element is required in a well-formed document.

So...

The XSP document appears to be correctly generating the XML document "doc.xml", because I can view it onscreen, but things don't go well when I try to include the same document using "document()".

Any thoughts?

Stuart.


-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Lead Developer                               Java, XML, MacOS X, XP, etc.
ADOLOS                                             http://www.adolos.com/