David,
thank you very much for your precious hints and sorry if my question was not
clear.
I don't know what "xalan-SAX" is. Can you be more specific? If you mean
using the class >"XalanDocumentBuilder," then you can send events that
contains Unicode characters that would be illegal in XML 1.0, but legal in
XML 1.1.
Yes, I meant "using XalanDocumentBuilder" and you hit the centre of the
question.
I tried to introduce a single Unicode control character in the
DocumentBuilder sample
in this way:
[...]
theAttributes.clear();
theAttributeName = XALAN_STATIC_UCODE_STRING("attribute2");
// I replaced the string "value2" with ""
theAttributeValue = XALAN_STATIC_UCODE_STRING("");
theAttributes.addAttribute(c_wstr(theAttributeName),
c_wstr(theAttributeType), c_wstr(theAttributeValue));
[...]
Applying a xslt such as
<?xml version="1.1" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output version="1.1"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
the output presents attribute2 with a string valued as "&#x004;"
instead of the corresponding control character.
The same behaviour if I use "�" even if I would expect an error, since
that
is the only unsupported unicode control character in XML 1.1.
Any suggestions/comments would be very appreciated.
Thanks,
Mauro.
----Original Message Follows----
From: David Bertoni <[EMAIL PROTECTED]>
Reply-To: xalan-c-users@xml.apache.org
To: xalan-c-users@xml.apache.org
Subject: Re: Programmatically create XML 1.1 Document
Date: Wed, 14 Jun 2006 17:31:03 -0700
mauro castelli wrote:
hi all,
I'm using the latest version of Xalan/Xerces in order to achieve xml 1.1
support.
Looking at the "Samples" to get ideas on how to programmatically create
an XML Document in memory: xerces/CreateDOMDocument (DOM) and
xalan/DocumentBuilder(SAX).
You'll have to ask the Xerces-specific questions on the Xerces-C user list.
Here is the question:
How can I specify, both with xerces-DOM and xalan-SAX, that I want to use
XML 1.1
instead of the default XML 1.0?
I don't know what "xalan-SAX" is. Can you be more specific? If you mean
using the class "XalanDocumentBuilder," then you can send events that
contains Unicode characters that would be illegal in XML 1.0, but legal in
XML 1.1.
If I then want to apply an XSL Transform, should I take care of something
special due to
the 1.1 version?
Your stylesheet will need an xsl:output element with a version attribute
with the value "1.1".
Note that XML 1.1 support in Xalan-C is still experimental, so you may
experience problems. Also, there is no support for "undeclaring"
namespaces, so you won't be able to use that feature of XML Namespaces 1.1.
Dave
_________________________________________________________________
Scarica gratuitamente MSN Toolbar! http://toolbar.msn.it/