Re: Python Tool for excerpting schema/examples into XHTML spec

At 12:00 2003 01 24 -0500, Joseph Reagle wrote:

>On Friday 24 January 2003 05:55, Henry S. Thompson wrote:
>> where xml2xmpl looks like this:
>>
>>         #!/bin/sh
>>         echo -n "<txt><![CDATA["
>>         rxp $@
>>         echo "]]></txt>"
>
>As an aside, I actually started out with trying to use XInclude which I 
>thought would be optimal but:

I agree, it should be.


>1. I couldn't figure out a way to include XInclude elements in XHTML and 
>have it remain valid XHTML.

The XInclude elements are namespaced.  Since DTDs aren't
namespace-aware, you either have to live with a document
that is well-formed but not DTD-valid, or you have to fiddle
the DTD to allow the xi:xinclude element in reasonable places.

Schema-validity should, of course, be doable.

You could do some trick such as use <a class="xinclude" href="..."/>
in your document so that it would validate and then write a trivial
XSLT transform sheet that maps the above into <xi:xinclude href="..."/>
just before you need to do the including.

>2. The returning XML isn't "encoded" for inclusion in XHTML, I thought of 
>putting it inside ![CDATA[ but figured it wouldn't work since CDATA is 
>*not* supposed to be parsed, and consequently the XInclude should be 
>ignored.

This is what XInclude's parse="text" attribute is for.  Quoting [1]:

  The fetched resource is treated as plain text and
  converted to a set of character information items without
  attempting to parse the resource as XML. This feature
  facilitates the inclusion of working XML examples, as well
  as other text-based formats.

>3. Not sure how good the XPtr support in XInclude implementations (e.g., 
>xmllint) is.

I'm not sure what xpointer support would have to do with this.
When you use parse="text", the "resource is treated as plain text"
so xpointer is irrelevant.

(But there are XInclude implementations [2] that do support
various levels of XPointer.)

paul

[1] http://www.w3.org/TR/2002/CR-xinclude-20020917/#text-included-items
[2] http://www.w3.org/XML/2002/09/xinclude-implementation

Received on Friday, 24 January 2003 12:30:50 UTC