Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » disable attribute xmlns writing
disable attribute xmlns writing [message #522422] Mon, 22 March 2010 10:40 Go to next message
Eclipse UserFriend
Originally posted by: murbieta.gpi.com.ar

Hi, i'm trying to write a xml using EMF that must be compliant with a
dtd. In order to achieve this goal i have removed name spaces and also
added doct type information. But i can't find the way for desabling
xmlns attribute in the generated xml. The generated xml looks like:

<?xml version="1.0" encoding="ASCII"?>
<!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow
2.6//EN" "http://www.opensymphony.com/osworkflow/workflow_2_6.dtd">
<workflow xmlns="http://myexample"/>

and must look like:

<?xml version="1.0" encoding="ASCII"?>
<!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow
2.6//EN" "http://www.opensymphony.com/osworkflow/workflow_2_6.dtd">
<workflow />

thanks in advance.
Re: disable attribute xmlns writing [message #522435 is a reply to message #522422] Mon, 22 March 2010 15:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Matias,

Write a simple schema, without a target namespace, for the XML you want
to achieve, build the model project for it, look closely at the
XyzResourceFactoryImpl's options and at the extended meta data
annotations on the Xyz EPackage. You'll want to replicate that for your
specific model.


Matias Urbieta wrote:
> Hi, i'm trying to write a xml using EMF that must be compliant with a
> dtd. In order to achieve this goal i have removed name spaces and also
> added doct type information. But i can't find the way for desabling
> xmlns attribute in the generated xml. The generated xml looks like:
>
> <?xml version="1.0" encoding="ASCII"?>
> <!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow
> 2.6//EN" "http://www.opensymphony.com/osworkflow/workflow_2_6.dtd">
> <workflow xmlns="http://myexample"/>
>
> and must look like:
>
> <?xml version="1.0" encoding="ASCII"?>
> <!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow
> 2.6//EN" "http://www.opensymphony.com/osworkflow/workflow_2_6.dtd">
> <workflow />
>
> thanks in advance.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: disable attribute xmlns writing [message #522782 is a reply to message #522435] Tue, 23 March 2010 17:06 Go to previous message
Eclipse UserFriend
Originally posted by: murbieta.gpi.com.ar

Hi Ed, i follow your advice and when comparing realize that i was
missing to add "qualified" parameter in metadata annotation.
It was solved as following:

<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model"
nsURI="..." nsPrefix="..">

<!-- this annotation avoids writing namespace information -->
<eAnnotations
source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="qualified" value="false"/>
</eAnnotations>
...

regards



Ed Merks escribió:
> Matias,
>
> Write a simple schema, without a target namespace, for the XML you want
> to achieve, build the model project for it, look closely at the
> XyzResourceFactoryImpl's options and at the extended meta data
> annotations on the Xyz EPackage. You'll want to replicate that for your
> specific model.
>
>
> Matias Urbieta wrote:
>> Hi, i'm trying to write a xml using EMF that must be compliant with a
>> dtd. In order to achieve this goal i have removed name spaces and also
>> added doct type information. But i can't find the way for desabling
>> xmlns attribute in the generated xml. The generated xml looks like:
>>
>> <?xml version="1.0" encoding="ASCII"?>
>> <!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow
>> 2.6//EN" "http://www.opensymphony.com/osworkflow/workflow_2_6.dtd">
>> <workflow xmlns="http://myexample"/>
>>
>> and must look like:
>>
>> <?xml version="1.0" encoding="ASCII"?>
>> <!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow
>> 2.6//EN" "http://www.opensymphony.com/osworkflow/workflow_2_6.dtd">
>> <workflow />
>>
>> thanks in advance.
Previous Topic:How to persist objects in model file
Next Topic:[EMF] Dynamic eGet for unsettable attributes
Goto Forum:
  


Current Time: Fri Apr 26 15:29:49 GMT 2024

Powered by FUDForum. Page generated in 0.03630 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top