Subject:XSD to XML - namespace "p1" generation Author:Bruno F Date:19 Sep 2005 08:27 AM
Hi,
generating XML from XSD works just fine, except for the individual namespace that is created for the new XML file.
Example XSD file (truncated):
<xs:schema xmlns="Abcd/Schemas/Agb/1101/20050317/1.0" elementFormDefault="qualified" targetNamespace="Abcd/Schemas/Agb/1101/20050317/1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
...
Generated XML file (truncated):
<?xml version="1.0"?>
<p1:Vga xmlns:p1="Abcd/Schemas/Agb/1101/20050317/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="Abcd/Schemas/Agb/1101/20050317/1.0 file:///c:/_test/regEx_test.xsd">
<!--Element p1:Text1 is optional-->
<p1:Text1>
...
Is it possible to:
1) avoid creation of the "p1" (or "p2" etc...) namespace and the usage of that namespace for all XML elements?
2) avoid creation of the "schemaLocation" attribute?
but this generates problems when a schema defines mixed elements (some in a namespace, some in another, some even in the empty namespace), so we chose not to use the default namespace
>2) avoid creation of the "schemaLocation" attribute?
If that attribute is missing, the XML is not bound to the schema used to create it, and cannot be validated.
Can I ask you why do you think you need no prefix and no schemaLocation attribute?