Re: How to change XML Serilization format [message #476706] |
Thu, 06 December 2007 07:50  |
Eclipse User |
|
|
|
Brajesh,
Comments below. I copied the UML2 newsgroup to get their opinion on
what you are trying to achieve.
brajesh K. wrote:
> Hi All!
> I need to change a bit the default XML serialization format.
> By default, the serialized document looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:uml="http://www.eclipse.org/uml2/1.0.0/UML"
> xmi:id="_0nu3QKO6Edy--aGJ0GKhYw">
> <ownedMember xmi:type="uml:Package" xmi:id="_SyEVEW-zEducsu2zqSynDA"
> name="ClassDiagram1">
> <ownedMember xmi:type="uml:Class" xmi:id="_1-AtsKO6Edy--aGJ0GKhYw"
> name="Class1">
> </ownedMember>
> </ownedMember>
> <ownedMember xmi:type="uml:PrimitiveType"
> xmi:id="_0_IDkKO6Edy--aGJ0GKhYw" name="String">
> </ownedMember>
> <ownedMember xmi:type="uml:PrimitiveType"
> xmi:id="_0_IDkaO6Edy--aGJ0GKhYw" name="Integer">
> </ownedMember>
> <ownedMember xmi:type="uml:PrimitiveType"
> xmi:id="_0_IDkqO6Edy--aGJ0GKhYw" name="Boolean">
> </ownedMember>
> <ownedMember xmi:type="uml:PrimitiveType"
> xmi:id="_0_IDk6O6Edy--aGJ0GKhYw" name="UnlimitedNatural">
> </ownedMember>
> </uml:Model>
This looks like the serialization of the UML2 model.
>
> I want it to look as follows:
>
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <XMI xmi.version="1.1" xmlns:UML="ABC">
> <XMI.header>
> <XMI.documentation>
> <XMI.exporter>XYZ</XMI.exporter>
> <XMI.exporterVersion>1.1</XMI.exporterVersion>
> </XMI.documentation>
> <XMI.metamodel xmi.name="UML" xmi.version="1.3"/>
> </XMI.header>
> <XMI.content>
> <UML:Model xmi.id="1100411" name="xmiconversion1" visibility="public"
> isSpecification="0" isRoot="0" isLeaf="0" isAbstract="0">
> <UML:Namespace.ownedElement>
> <UML:Package xmi.id="1000000" name="" visibility="public"
> isSpecification="0" isRoot="0" isLeaf="0" isAbstract="0"
> namespace="1100411">
> <UML:Namespace.ownedElement>
> <UML:Class namespace="1000000" xmi.id="1253556" name="class2"
> visibility="public" isSpecification="0" isRoot="0" isLeaf="0"
> isAbstract="false" isActive="0">
> <UML:Classifier.feature>
> <UML:Operation xmi.id="1253557" name="class2" visibility="public"
> isSpecification="0" ownerScope="instance" isQuery="0"
> concurrency="Sequential" isRoot="0" isLeaf="-1" isAbstract="false"
> specification=""/>
> </UML:Classifier.feature> </UML:Class>
>
This doesn't tell me the general pattern you are trying to follow (and
the it's not even well formed XML). Does this conform to some old
version of the UML specification? What tool needs XMI 1.3 support?
I'd be surprised that IDs should just be numbers since that doesn't
conform to XML Schema's constraint that it be an NCName (and hence must
start with a letter). You'd have a specialize an awful lot of the
XMLSaveImpl code to achieve a result like the above and I'm not even
sure what the pattern is...
> Pls. let me know how can i do this. Regds
> Brajesh
>
|
|
|
|
Re: How to change XML Serilization format [message #476715 is a reply to message #476714] |
Fri, 07 December 2007 08:52  |
Eclipse User |
|
|
|
Brajesh,
As I said, you'd have to specialize an awful lot of the XMLSaveImpl code
to achieve this result.
brajesh K. wrote:
> Hi Ed,
> Thanks for Reply.
> yes my existing XML is serialization of the UML2 model.
> and my expected XML would follow XMI 1.1 spec.
> Yes ID's is just a number but i can chage it alphanumeric format.
>
> currently i have serialized XMI of UML2 model as it shown earlier.
> and i want to serialize UML2 MODEL to different format instead of
> default
> XMI serialization format.
>
> and my expected format look like this.
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <XMI xmi.version="1.1" xmlns:UML="ABC">
> <XMI.header>
> <XMI.documentation>
> <XMI.exporter>XYZ</XMI.exporter>
> <XMI.exporterVersion>1.1</XMI.exporterVersion>
> </XMI.documentation>
> <XMI.metamodel xmi.name="UML" xmi.version="1.3"/>
> </XMI.header>
> <XMI.content>
> <UML:Model>
> <UML:Namespace.ownedElement>
> <UML:Package>
> <UML:Namespace.ownedElement>
> <UML:Class>
> <UML:Classifier.feature>
> <UML:Operation>
> </UML:Classifir.feature>
> </UML:Class>
> </UML:Package>
> </UML:Model>
> </XMI.content>
>
> is it possible to serialize UML2 model to above given format instead
> of default one? if yes pls. let me know how to do this.
> can it is done by USING XSLT Trasforamtion.
> Regds
> brajesh
>
>
>
>
>
>
>
>
|
|
|
Re: How to change XML Serilization format [message #625686 is a reply to message #476706] |
Fri, 07 December 2007 00:23  |
Eclipse User |
|
|
|
Hi Ed,
Thanks for Reply.
yes my existing XML is serialization of the UML2 model.
and my expected XML would follow XMI 1.1 spec.
Yes ID's is just a number but i can chage it alphanumeric format.
currently i have serialized XMI of UML2 model as it shown earlier.
and i want to serialize UML2 MODEL to different format instead of default
XMI serialization format.
and my expected format look like this.
<?xml version="1.0" encoding="ISO-8859-1"?>
<XMI xmi.version="1.1" xmlns:UML="ABC">
<XMI.header>
<XMI.documentation>
<XMI.exporter>XYZ</XMI.exporter>
<XMI.exporterVersion>1.1</XMI.exporterVersion>
</XMI.documentation>
<XMI.metamodel xmi.name="UML" xmi.version="1.3"/>
</XMI.header>
<XMI.content>
<UML:Model>
<UML:Namespace.ownedElement>
<UML:Package>
<UML:Namespace.ownedElement>
<UML:Class>
<UML:Classifier.feature>
<UML:Operation>
</UML:Classifir.feature>
</UML:Class>
</UML:Package>
</UML:Model>
</XMI.content>
is it possible to serialize UML2 model to above given format instead of
default
one? if yes pls. let me know how to do this.
can it is done by USING XSLT Trasforamtion.
Regds
brajesh
|
|
|
Re: How to change XML Serilization format [message #625687 is a reply to message #476714] |
Fri, 07 December 2007 08:52  |
Eclipse User |
|
|
|
Brajesh,
As I said, you'd have to specialize an awful lot of the XMLSaveImpl code
to achieve this result.
brajesh K. wrote:
> Hi Ed,
> Thanks for Reply.
> yes my existing XML is serialization of the UML2 model.
> and my expected XML would follow XMI 1.1 spec.
> Yes ID's is just a number but i can chage it alphanumeric format.
>
> currently i have serialized XMI of UML2 model as it shown earlier.
> and i want to serialize UML2 MODEL to different format instead of
> default
> XMI serialization format.
>
> and my expected format look like this.
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <XMI xmi.version="1.1" xmlns:UML="ABC">
> <XMI.header>
> <XMI.documentation>
> <XMI.exporter>XYZ</XMI.exporter>
> <XMI.exporterVersion>1.1</XMI.exporterVersion>
> </XMI.documentation>
> <XMI.metamodel xmi.name="UML" xmi.version="1.3"/>
> </XMI.header>
> <XMI.content>
> <UML:Model>
> <UML:Namespace.ownedElement>
> <UML:Package>
> <UML:Namespace.ownedElement>
> <UML:Class>
> <UML:Classifier.feature>
> <UML:Operation>
> </UML:Classifir.feature>
> </UML:Class>
> </UML:Package>
> </UML:Model>
> </XMI.content>
>
> is it possible to serialize UML2 model to above given format instead
> of default one? if yes pls. let me know how to do this.
> can it is done by USING XSLT Trasforamtion.
> Regds
> brajesh
>
>
>
>
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04099 seconds