You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Thomas Porschberg <th...@osp-dd.de> on 2002/09/18 10:06:03 UTC

question regarding CreateDOMDocument and umlaute

I have a question regarding the XStr class in 
CreateDOMDocument.

// ---------------------------------------------------------------------------
//  This is a simple class that lets us do easy (though not terribly efficient)
//  trancoding of char* data to XMLCh data.
// ---------------------------------------------------------------------------
class XStr
...

Can I expect from the XMLString::transcode method that it translate
umlaute like ä,ß,Ö in a correct XMLChar ?

I changed the string "Apache Software Foundation" in the sample code 
to "Äpache Software Foundation" and the result is that the string
disappears in the output.

from: <developedBy>Apache Software Foundation</developedBy>
to  : <developedBy/>

I tried to use a XML88591Transcoder instance in conjunction with TranscodeFrom,
but the same result.

My $LANG environment variable is set to "de_DE@euro", 
I set it to "de_DE" and compiled the application new, but the same result again.

What is a straightforward way to do this ?

Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: Process content for attributes

Posted by David Sheldon <dw...@decisionsoft.com>.
On Wed, Sep 18, 2002 at 05:28:26PM +0100, Graham Mann wrote:

> I've been using the example DOMCount (with switches -n -s -v=always)
> from Xerces 2.1.0 to validate a document against a schema.
>
> I believe I've uncovered a problem with wildcard attributes and the
> processContents setting:
> 
> So for an element which has an attributes declared like
>       <xs:attribute name="Good" type="xs:NMTOKEN"/>
>       <xs:anyAttribute namespace="##other" processContents="strict"/>
> 
> Changing the schema setting for  processContents setting and
> validating a document like
>       <TESTELEMENT Good="OK" Bad="AlsoOK" OTHER_NS:WhatEver="49" />
> 
> Note there is no schema for the OTHER_NS

I believe that xerces is acting correctly in this case, if a little
unintuitively. The ##other in the anyAttribute definition is relative to
the 
  " targetNamespace [attribute] of the <schema> ancestor element
  information item "
  (http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#declare-openness
  referenced from
  http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#element-anyAttribute)


The namespace that the Bad attribute is in is the null namespace. It is
unlikely that your schema containing TESTELEMENT is in the null
namespace. In this case the Bad attribute is in another namespace. Hence
Bad should be treated the same as OTHER_NS:WhatEver, if you are using
##other, or ##any for your anyAttribute.

That said, your interpretation was what I expected until I read the spec
in detail. 

David
-- 
David Sheldon, Client Services        DecisionSoft Ltd.
Telephone: +44-1865-203192            http://www.decisionsoft.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org