Editing xml from RNG schema with fixed attrib of type QName

This should cover W3C XML Schema, Relax NG and DTD related problems.

Editing xml from RNG schema with fixed attrib of type QName

Postby PaulHermans » Fri Apr 18, 2008 12:27 pm

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
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

Postby george » Fri Apr 18, 2008 2:05 pm

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
george
Site Admin
 
Posts: 2061
Joined: Thu Jan 09, 2003 2:58 pm

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

Postby Radu » Tue Apr 22, 2008 10:16 am

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, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Radu
 
Posts: 2014
Joined: Fri Jul 09, 2004 5:18 pm

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

Postby PaulHermans » Tue Apr 22, 2008 11:30 am

Thanks.


Paul
Paul
PaulHermans
 
Posts: 82
Joined: Sat Jan 13, 2007 5:39 pm
Location: Belgium


Return to XML Schemas

Who is online

Users browsing this forum: No registered users and 0 guests