Editing xml from RNG schema with fixed attrib of type QName

This should cover W3C XML Schema, Relax NG and DTD related problems.
PaulHermans
Posts: 82
Joined: Sat Jan 13, 2007 5:39 pm
Location: Belgium

Editing xml from RNG schema with fixed attrib of type QName

Post by PaulHermans »

I have following example schema

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0"
xmlns:overheid="test"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<element name="test" >
<attribute name="scheme">
<value type="QName">overheid:Gemeente</value>
</attribute>
</element>
</start>
</grammar>
Starting a fresh document leads to following instance:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="file:/Users/Paul/Desktop/test.rng" type="xml"?>
<test scheme="com.thaiopensource.datatype.xsd.QNameDatatype$QName@6e31ac62"

</test>
Is there something wrong with the schema or ?

Paul
Paul
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Editing xml from RNG schema with fixed attrib of type QName

Post by george »

Hi Paul,

oXygen tries to insert also the value and it looks like we are using toString() to get a string representation to be inserted. The QName class does not implement toString and thus the default value that you get in the instance document.

Now, things are a little more complicated for inserting QName vales as they need to be resolved in the current namespace context. I will record this problem and we will investigate possible solutions. Of course a simple step is to offer no value when we have a QName, that fixes the wrong behavior at least.

Thanks,
George
George Cristian Bina
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: Editing xml from RNG schema with fixed attrib of type QName

Post by Radu »

Dear Paul,

We fixed QName insertion for RelaxNG to insert the value correctly by taking into account the available prefix in the current context for the QName namespace.
The fix will be available in 9.2 (probably in a couple of weeks).

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
PaulHermans
Posts: 82
Joined: Sat Jan 13, 2007 5:39 pm
Location: Belgium

Re: Editing xml from RNG schema with fixed attrib of type QName

Post by PaulHermans »

Thanks.


Paul
Paul
Post Reply