[
Lists Home |
Date Index |
Thread Index
]
Mike Champion <mc@xegesis.org> writes:
> - [quoting directly from Prescod] "Data-oriented
> systems tend to prefer object types to be detectable
> independent of context (thus namespaces) whereas
> document processing is typically done top-down
> recursively so relying on context is natural."
I'm not sure about that one. I found myself using namespaces in STnG
where I could have used context precisely because the documents are
intended to be human-readable (and human-authorable) and I want the
reader to see what he is dealing with. I use a
sort-of-literate-programming style, where fragments of RLAXNG, XSLT
and my own declarations are documented using fragments of XHTML. I
want the reader to be able to know right away which part of the
document he's looking at without having to scroll up or down to find
the context.
Ari.
[full document at http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/stng/STnG/literate/reader.sld?rev=HEAD&content-type=text/vnd.viewcvs-markup]
<sld:stingie>
<sld:name>st:reader</sld:name>
<sld:class>reader</sld:class>
<sld:content-model>
<rng:element name="st:reader">
<rng:zeroOrMore>
<!-- other RNG declarations -->
</rng:zeroOrMore>
</rng:element>
</sld:content-model>
<sld:effect>
<h:p>Specifies an XML reader and a way to control its reatures and
properties.</h:p>
<!-- more XHTML documentation -->
</sld:effect>
<sld:examples>
<sld:example title="A validating identity transform">
<sld:stng>
<sld:block-xml xml:space="preserve">
<!-- any XML cn go here -->
</sld:block-xml>
</sld:stng>
<h:p>This STnG specifies only a reader, with no filter and a
defaulted serializer. On the reader, valudation is turned on and
namespace processing is turned off. You can use this STNG as a
simple command-line validator. The input document is serialized
back to standard output. Note that the validator will add and
attibutes defaulted in the DTD.</h:p>
</sld:example>
</sld:examples>
<sld:implementation>
<java:class package="org.xml.sax">XMLReader</java:class>
<java:variable-prefix>xr</java:variable-prefix>
<sjc:complet>
<sjc:template>
<xsl:choose>
<xsl:when test="@java:class!='org.xml.sax.XMLReader'">
<!-- Non-default: user specified a class explicitly -->
<sjc:class/> <sjc:identifier/> = new <sjc:class/> ();
<!-- more XSLT -->
</xsl:template>
</sjc:complet>
</sld:implementation>
<sld:entomology>
<sld:notTested/>
</sld:entomology>
</sld:stingie>
|