Page 1 of 1

namespace choice withTools -> Generating Sample XML file

Posted: Tue Mar 22, 2011 5:06 pm
by PaulHermans
<oXygen/> XML Editor 12.1, build 2011031114

XSD snippet

Code: Select all


<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.example.com/vocab/product"
targetNamespace="http://www.example.com/vocab/product"
elementFormDefault="qualified"
>
<xsd:import
namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
schemaLocation="rdf.xsd" />
<xsd:import
namespace="http://www.w3.org/1999/xhtml"
schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" />
<xsd:include
schemaLocation="datatypes.xsd" />
<xsd:element
name="product">...</xsd:element>
having only one root element in the target namespace schema.

With Oxygen's Tools -> Generating Sample XML file
I get http://www.w3.org/1999/xhtml as namespace and only xhtml elements as potential root elements.

While another product generates

Code: Select all


<?xml version="1.0"?>
<p1:product p2:about="URI" xmlns:p1="http://www.example.com/vocab/product"
xmlns:p2="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.example.com/vocab/product ./IPDC.xsd">
<!--Attribute p2:about is optional-->
<p1:ID>URI</p1:ID>
<p1:titel>string</p1:titel>
<p1:naam>string</p1:naam>
<p1:inhoud>
<!--'Sequence' block is optional-->
<!--Any Element, maxOccurs=unbounded-->
<any_element/>
<any_element/>
<any_element/>
</p1:inhoud>
....
</p1:product>
conforming to my expectations.

Am I overlooking something to get the correct target namespace in Oxygen?

Re: namespace choice withTools -> Generating Sample XML file

Posted: Wed Mar 23, 2011 11:20 am
by sorin_ristache
Hello,

In Oxygen I get in the Root Element combo box all the XHTML elements and the product one from the http://www.example.com/vocab/product namespace. If I select product the http://www.example.com/vocab/product namespace is selected in the Namespace box and I can generate an XML instance with the product root element. Did you try to select product in the Root Element combo box?


Regards,
Sorin

Re: namespace choice withTools -> Generating Sample XML file

Posted: Wed Mar 23, 2011 3:55 pm
by PaulHermans
Indeed.

I expected, according to the order of the fields, that I could first choose the namespace and then the element, but it works the other way around.

Thanks.


Paul

Re: namespace choice withTools -> Generating Sample XML file

Posted: Wed Mar 23, 2011 4:02 pm
by sorin_ristache
I think you are right, the namespace box should be a combo box too. I will file an enhancement request in our system.


Regards,
Sorin