W3C home > Mailing lists > Public > www-xml-xinclude-comments@w3.org > January 2003

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

From: Joseph Reagle <reagle@w3.org>
Date: Mon, 27 Jan 2003 15:39:09 -0500
To: www-xml-xinclude-comments@w3.org
Message-Id: <200301271539.10299.reagle@w3.org>


Could you please confirm that it is not possible, using XInclude, to specify 
(via XPtr) a portion of an XML document (e.g., a particular schema 
complexType definition) and return it as encoded (textual) XML? That is, if 
I want to use XInclude to include examples or schemas within an XHTML 
specification, I can only do so for whole resources and not their 
excerptions? Thank you.

----------  Forwarded Message  ----------

Subject: Re: Python Tool for excerpting schema/examples into XHTML spec
Date: Friday 24 January 2003 12:48
From: Joseph Reagle <reagle@w3.org>
To: Paul Grosso <pgrosso@arbortext.com>, David Carlisle <davidc@nag.co.uk>
Cc: spec-prod@w3.org

On Friday 24 January 2003 12:30, Paul Grosso wrote:
> Schema-validity should, of course, be doable.

I expect at some point we'll have XHTML+XInclude. I believe that's a
 feature of XHTML2.0, but also expect there might be an intermediary
identifier/namespace/DTD from XHTML1.* .

> This is what XInclude's parse="text" attribute is for.  Quoting [1]:
> ...
> 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.

The tricky bit is actually between these two requirements.  I know a common
source of errata in my specs is typos between the in-line and external
schema and in the in-line examples. Consequently, it'd be better to
maintain the schema and examples externally, and keep them all valid.
(Which means not in little fragments.) So, when I want to include part of
an example or schema I want to use xptr to select the relevant part and
include it. If I understand, I can't do that if the parse type is text; and
if it's not text then it is returned as XML. What I'd need it a:
parse="xml" return="text"?

So in my script I evaluate the XPath, Canonicalize the result,and return
 the encoded XML (e.g., '<', '>','&') in a <pre> element:

nodes = expression.evaluate(context)
...
  for node in nodes:
    chunk = Canonicalize(node,unsuppressedPrefixes=[])
    chunk = '<pre class="%s">%s</pre>' % (hclass, encode(chunk))

-------------------------------------------------------

-- 
Joseph Reagle Jr.                 http://www.w3.org/People/Reagle/
W3C Policy Analyst                mailto:reagle@w3.org
IETF/W3C XML-Signature Co-Chair   http://www.w3.org/Signature/
W3C XML Encryption Chair          http://www.w3.org/Encryption/2001/
Received on Monday, 27 January 2003 15:39:12 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 19:58:56 UTC