Actually I am generating jar our of this XSD and also using the following
options
HashMap ns = new HashMap();
ns.put("http://www.starstandards.org/STAR", "xmlns:s");
ns.put("http://www.gm.com/2006/GWM", "xmlns:gwm");
ns.put("http://www.gm.com/2006/GWMv1.01\\GWM_TI_ProcessRepairOrder.xsd",
"xsi:schemaLocation");
private ProcessRepairOrderDocument processRepairDoc;
processRepairDoc.save(new File("C:\\work\\test.xml"), xmlOptions);
What I need a s namespace instead of star. Please help asap.
Thanks
Sharad
Radu Preotiuc-Pietro-2 wrote:
>
> If I understand this correctly, you object to the use of the prefix "star"
> by the instance generator tool. Unfortunately, xsd2inst doesn't have any
> option that allows you to customize the ns prefixes that are used; anyway
> it would be pretty ugly to specify URI->prefix mappings on the
> command-line.
>
> But I must confess that I am surprised that you are ok with the text of
> all the elements being the default "string" text and at the same time
> bothered by the namespace prefix.
>
> Radu
>
>> -----Original Message-----
>> From: sg0210 [mailto:[email protected]]
>> Sent: Monday, April 20, 2009 11:50 AM
>> To: [email protected]
>> Subject: While generating not adding namespace Issue
>>
>>
>> Internally in our xml generation logic we are using apache
>> xmlbeans to create or build ProcessRepairOrder XML(s),
>> however when I use xsd2inst command it is adding star
>> namespace by default but we would like to add <s> namespace
>> instead of <star> (refer attached XSD schemas and sample xml file).
>> It looks like it is XSD design issue, so please let me know
>> if you have any suggestions or can help us to sort out this problem.
>>
>> My Schema
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!-- edited with XMLSpy v2006 sp2 U (http://www.altova.com)
>> by Robert Loesch
>> (IBM) -->
>> <xs:schema xmlns:gwm="http://www.gm.com/2006/GWM"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> targetNamespace="http://www.gm.com/2006/GWM"
>> xmlns:s="http://www.starstandards.org/STAR"
>> elementFormDefault="qualified" attributeFormDefault="unqualified">
>> <xs:import namespace="http://www.starstandards.org/STAR"
>> schemaLocation="ProcessRepairOrder.xsd "/>
>> <xs:complexType name="DataAreaExtended">
>> <xs:complexContent>
>> <xs:extension
>> base="s:ProcessRepairOrderDataArea">
>> <xs:sequence>
>> <xs:element
>> name="RepairOrderCount" type="xs:integer" minOccurs="0"/>
>> </xs:sequence>
>> </xs:extension>
>> </xs:complexContent>
>> </xs:complexType>
>> .....
>> ProcessRepairOrder.xsd (Schema)
>>
>> <xs:schema attributeFormDefault="unqualified"
>> elementFormDefault="qualified"
>> targetNamespace="http://www.starstandards.org/STAR"
>> xmlns="http://www.starstandards.org/STAR"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>> <xs:complexType name="ProcessRepairOrderDataArea">
>>
>>
>> xsd2inst schemafile.xsd -name globalElementName xsd2inst
>> GWM_TI_ProcessRepairOrder.xsd -name ProcessRepairOrder | more
>> Output <star:ProcessRepairOrder revision="3.0" release="8.1-Lite"
>> environment="Product
>> on" lang="so-SO" xmlns:star="http://www.starstandards.org/STAR">
>> <star:ApplicationArea>
>> <star:Sender>
>> <!--Optional:-->
>> <star:LogicalId>string</star:LogicalId>
>> <star:Component>string</star:Component>
>> <star:Task>string</star:Task>
>> <!--Optional:-->
>> <star:ReferenceId>string</star:ReferenceId>
>> <!--Optional:-->
>> <star:AuthorizationId>string</star:AuthorizationId>
>> <star:CreatorNameCode>string</star:CreatorNameCode>
>> <star:SenderNameCode>string</star:SenderNameCode>
>> <!--Optional:-->
>> <star:SenderURI>http://www.company.org/sonoras/aeoliam</star:S
>> enderURI>
>> <!--Optional:-->
>> <star:DealerNumber>string</star:DealerNumber>
>> http://xmlbeans.apache.org/docs/2.0.0/guide/tools.html#scomp
>>
>> Refer files
>>
>> http://www.nabble.com/file/p23139344/GWM_TI_ProcessRepairOrder.xsd
>> GWM_TI_ProcessRepairOrder.xsd
>> http://www.nabble.com/file/p23139344/ProcessRepairOrder.xsd
>> ProcessRepairOrder.xsd
>> http://www.nabble.com/file/p23139344/star_repairorder.xml
>> star_repairorder.xml (Output getting)
>> http://www.nabble.com/file/p23139344/srepairOrder.xml
>> srepairOrder.xml (Output Desired)
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/While-generating-not-adding-namespace-Is
>> sue-tp23139344p23139344.html
>> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
--
View this message in context:
http://www.nabble.com/While-generating-not-adding-namespace-Issue-tp23139344p23175447.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]