You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Sachin Patel <sp...@gmail.com> on 2005/10/11 21:07:00 UTC

[Fwd: Re: rid of all ns prefixes]

Is the following statement true?? How is geronimo being able to process 
deployment plans without declaring all namespaces in a plan and 
qualifying the elements?

Sachin.

-------- Original Message --------
Subject: Re: rid of all ns prefixes
Date: Tue, 11 Oct 2005 12:56:09 -0600
From: Dave Carlson <dc...@xmlmodeling.com>
Organization: XMLmodeling.com
Newsgroups: eclipse.tools.emf
References: <di...@news.eclipse.org> 
<di...@news.eclipse.org> <di...@news.eclipse.org>

The XML spec does not require a schema for well-formed XML documents.  From
your description, it sounds like Geronimo has written a custom application
that "knows" how to load the XML stream without reference to any schemas.
Unfortunately, it is impossible to use a general purpose modeling tool like
EMF (or any other Java-binding framework) without well-defined schemas and
their required namespaces/prefixes.

"Sachin Patel" <sp...@gmail.com> wrote in message
news:digu6l$3ml$1@news.eclipse.org...
> What I'm generating is the server specific deployment descriptors for 
> Apache Geronimo.  I see what you are saying, and I'm not sure exactly how 
> the server is able to load the plans without the namespace declarations, 
> but when creating these plans for Geronimo, the elements without being 
> qualified are able to be loaded and processed by the server.  Will post on 
> their dev list on how exactly they are accomplishing this, but I would 
> like to take those existing plans from there "samples" which contain 
> contain no qualified elements and be able to load and parse them with my 
> EMF model.
>
> So its more of a compatibility reason for which I need to be able to do 
> this.  The sample applications in geronimo should be able to be imported 
> into WTP and be processed my EMF model which are based on the same exact 
> schemas.  But the xml files in these sample applications do not contain 
> fully qualified elements.
>
>



Re: SchemaConversions (was Re: [Fwd: Re: rid of all ns prefixes])

Posted by Sachin Patel <sp...@gmail.com>.
Sweet... works great!  (Had some other issues, which led me down the 
point of pulling down the xmlbeans to hunt down a NPE which I found the 
cause to be needing the naming-builder jar for the naming elements to 
resolve...).  Now just gotta do this for the rest of the plans.

(1) Are there any special cases I need to consider or is calling 
fixGeronimoSchema() suffient for all scenarios?
(2) Also for my knowlege, why and what conversion is being done on the 
spec dd's?

Thanks again, Sachin.

David Jencks wrote:
>
> On Oct 13, 2005, at 6:28 AM, Sachin Patel wrote:
>
>> David,
>>
>> So an validation exception is being thrown on my call to 
>> SchemaConversionUtil.fixGeronimoSchema(...) and can't seem to figure 
>> out why... Perhaps you can shed some light?
>
>> WebAppDocument webDoc = (WebAppDocument) 
>> plan.changeType(WebAppDocument.type);
>
> This claims that your document is a spec dd
>> WebAppType web = (WebAppType) 
>> SchemaConversionUtils.fixGeronimoSchema(webDoc, "web-app", 
>> WebAppDocument.type);
>
> This attempts to convert the web-app element into a spec dd document.  
> This is why the errors are even stranger than they might be :-)
>
> I think you want  only one line,
>
> GerWebAppType webApp = (GerWebAppType) 
> SchemaConversionUtils.fixGeronimoSchema(plan, "web-app", 
> GerWebAppType.type);
>
> Hope I'm close to right :-)
>
> david jencks
>
>
>>
>> I start with the following hand written plan...
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0" 
>> configId="test/test">
>>  <context-root>/test</context-root>
>>  <context-priority-classloader>false</context-priority-classloader>
>>  <resource-env-ref>
>>    <ref-name>blah</ref-name>
>>    <message-destination-link>blah</message-destination-link>
>>  </resource-env-ref>
>> </web-app>
>>
>>
>> I then call the following snippet of code...
>>
>>
>> XmlObject plan = 
>> XmlBeansUtil.parse(dpFile.getLocation().toFile().toURL());
>> WebAppDocument webDoc = (WebAppDocument) 
>> plan.changeType(WebAppDocument.type);
>> WebAppType web = (WebAppType) 
>> SchemaConversionUtils.fixGeronimoSchema(webDoc, "web-app", 
>> WebAppDocument.type);
>>
>>
>> The following exception is thrown although the converted plan in the 
>> exception seems to be correct...
>>
>> org.apache.xmlbeans.XmlException: Invalid deployment descriptor: 
>> [error: cvc-complex-type.3.2.1: Attribute not allowed (no wildcards 
>> allowed): configId, error: cvc-complex-type.2.4a: Expected element 
>> 'web-app@http://java.sun.com/xml/ns/j2ee' instead of 
>> 'context-root@http://geronimo.apache.org/xml/ns/j2ee/web-1.0' here, 
>> error: cvc-complex-type.2.4a: Expected element 
>> 'web-app@http://java.sun.com/xml/ns/j2ee' instead of 
>> 'context-priority-classloader@http://geronimo.apache.org/xml/ns/j2ee/web-1.0' 
>> here, error: cvc-complex-type.2.4a: Expected element 
>> 'web-app@http://java.sun.com/xml/ns/j2ee' instead of 
>> 'resource-env-ref@http://geronimo.apache.org/xml/ns/naming-1.0' here, 
>> error: cvc-complex-type.2.4c: Expected element 
>> 'web-app@http://java.sun.com/xml/ns/j2ee' before the end of the content]
>>
>> Descriptor: <xml-fragment configId="test/test" 
>> xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-1.0" 
>> xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0">
>>  <web:context-root>/test</web:context-root>
>>  <web:context-priority-classloader>false</web:context-priority-classloader> 
>>
>>  <nam:resource-env-ref>
>>    <nam:ref-name>blah</nam:ref-name>
>>    <nam:message-destination-link>blah</nam:message-destination-link>
>>  </nam:resource-env-ref>
>> </xml-fragment>
>>   at 
>> org.apache.geronimo.schema.SchemaConversionUtils.validateDD(SchemaConversionUtils.java:594) 
>>
>>    at 
>> org.apache.geronimo.schema.SchemaConversionUtils.fixGeronimoSchema(SchemaConversionUtils.java:360) 
>>
>>
>> Any ideas as to what is wrong?
>>
>> Thanks,
>>
>> Sachin
>>
>> David Jencks wrote:
>>>
>>> On Oct 11, 2005, at 6:04 PM, Sachin Patel wrote:
>>>
>>>>
>>>> David Jencks wrote:
>>>>>
>>>>>
>>>>> I'd have the issue say that the eclipse stuff should pre-convert 
>>>>> the plans using SchemaConversionUtils.  We'll find out soon enough 
>>>>> what needs to change :-)  Is there an easy to find point in the 
>>>>> eclipse stuff where you know what kind of plan it is and want to 
>>>>> convert it?
>>>> Well when importing a J2EE app or module into WTP a new 
>>>> "project/component" is always created for every module in that 
>>>> application and so I'll know every module type and thus should 
>>>> automatically know the j2ee plan type during the import.  This 
>>>> import operation is extendable and I'll be able to do this 
>>>> conversion then for every module.  (With nested plans, it may be a 
>>>> little tricker, will have to put some thought into that...)
>>>
>>> An ear plan always has namespaces for the plans for the modules.  
>>> They could be the old unversioned namespaces (missing -1.0 at the 
>>> end) but they are sufficient to identify what you should end up 
>>> with.  The web plans are a little trickier, since after figuring out 
>>> which builder we will use the generic geronimo-web docs are 
>>> converted to container-specific docs.  Are you planning to generate 
>>> generic web plans or container specific web plans or give the user a 
>>> choice?
>>>
>>> An ear plan will still need some namespace conversion to get the 
>>> dependencies and gbeans.
>>>
>>> thanks
>>> david jencks
>>>
>>>
>>
>
>

Re: SchemaConversions (was Re: [Fwd: Re: rid of all ns prefixes])

Posted by David Jencks <da...@yahoo.com>.
On Oct 13, 2005, at 6:28 AM, Sachin Patel wrote:

> David,
>
> So an validation exception is being thrown on my call to  
> SchemaConversionUtil.fixGeronimoSchema(...) and can't seem to figure  
> out why... Perhaps you can shed some light?

> WebAppDocument webDoc = (WebAppDocument)  
> plan.changeType(WebAppDocument.type);

This claims that your document is a spec dd
> WebAppType web = (WebAppType)  
> SchemaConversionUtils.fixGeronimoSchema(webDoc, "web-app",  
> WebAppDocument.type);

This attempts to convert the web-app element into a spec dd document.   
This is why the errors are even stranger than they might be :-)

I think you want  only one line,

GerWebAppType webApp = (GerWebAppType)  
SchemaConversionUtils.fixGeronimoSchema(plan, "web-app",  
GerWebAppType.type);

Hope I'm close to right :-)

david jencks


>
> I start with the following hand written plan...
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"  
> configId="test/test">
>  <context-root>/test</context-root>
>  <context-priority-classloader>false</context-priority-classloader>
>  <resource-env-ref>
>    <ref-name>blah</ref-name>
>    <message-destination-link>blah</message-destination-link>
>  </resource-env-ref>
> </web-app>
>
>
> I then call the following snippet of code...
>
>
> XmlObject plan =  
> XmlBeansUtil.parse(dpFile.getLocation().toFile().toURL());
> WebAppDocument webDoc = (WebAppDocument)  
> plan.changeType(WebAppDocument.type);
> WebAppType web = (WebAppType)  
> SchemaConversionUtils.fixGeronimoSchema(webDoc, "web-app",  
> WebAppDocument.type);
>
>
> The following exception is thrown although the converted plan in the  
> exception seems to be correct...
>
> org.apache.xmlbeans.XmlException: Invalid deployment descriptor:  
> [error: cvc-complex-type.3.2.1: Attribute not allowed (no wildcards  
> allowed): configId, error: cvc-complex-type.2.4a: Expected element  
> 'web-app@http://java.sun.com/xml/ns/j2ee' instead of  
> 'context-root@http://geronimo.apache.org/xml/ns/j2ee/web-1.0' here,  
> error: cvc-complex-type.2.4a: Expected element  
> 'web-app@http://java.sun.com/xml/ns/j2ee' instead of  
> 'context-priority-classloader@http://geronimo.apache.org/xml/ns/j2ee/ 
> web-1.0' here, error: cvc-complex-type.2.4a: Expected element  
> 'web-app@http://java.sun.com/xml/ns/j2ee' instead of  
> 'resource-env-ref@http://geronimo.apache.org/xml/ns/naming-1.0' here,  
> error: cvc-complex-type.2.4c: Expected element  
> 'web-app@http://java.sun.com/xml/ns/j2ee' before the end of the  
> content]
>
> Descriptor: <xml-fragment configId="test/test"  
> xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-1.0"  
> xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0">
>  <web:context-root>/test</web:context-root>
>   
> <web:context-priority-classloader>false</web:context-priority- 
> classloader>
>  <nam:resource-env-ref>
>    <nam:ref-name>blah</nam:ref-name>
>    <nam:message-destination-link>blah</nam:message-destination-link>
>  </nam:resource-env-ref>
> </xml-fragment>
>   at  
> org.apache.geronimo.schema.SchemaConversionUtils.validateDD(SchemaConve 
> rsionUtils.java:594)
>    at  
> org.apache.geronimo.schema.SchemaConversionUtils.fixGeronimoSchema(Sche 
> maConversionUtils.java:360)
>
> Any ideas as to what is wrong?
>
> Thanks,
>
> Sachin
>
> David Jencks wrote:
>>
>> On Oct 11, 2005, at 6:04 PM, Sachin Patel wrote:
>>
>>>
>>> David Jencks wrote:
>>>>
>>>>
>>>> I'd have the issue say that the eclipse stuff should pre-convert  
>>>> the plans using SchemaConversionUtils.  We'll find out soon enough  
>>>> what needs to change :-)  Is there an easy to find point in the  
>>>> eclipse stuff where you know what kind of plan it is and want to  
>>>> convert it?
>>> Well when importing a J2EE app or module into WTP a new  
>>> "project/component" is always created for every module in that  
>>> application and so I'll know every module type and thus should  
>>> automatically know the j2ee plan type during the import.  This  
>>> import operation is extendable and I'll be able to do this  
>>> conversion then for every module.  (With nested plans, it may be a  
>>> little tricker, will have to put some thought into that...)
>>
>> An ear plan always has namespaces for the plans for the modules.   
>> They could be the old unversioned namespaces (missing -1.0 at the  
>> end) but they are sufficient to identify what you should end up with.  
>>  The web plans are a little trickier, since after figuring out which  
>> builder we will use the generic geronimo-web docs are converted to  
>> container-specific docs.  Are you planning to generate generic web  
>> plans or container specific web plans or give the user a choice?
>>
>> An ear plan will still need some namespace conversion to get the  
>> dependencies and gbeans.
>>
>> thanks
>> david jencks
>>
>>
>


SchemaConversions (was Re: [Fwd: Re: rid of all ns prefixes])

Posted by Sachin Patel <sp...@gmail.com>.
David,

So an validation exception is being thrown on my call to 
SchemaConversionUtil.fixGeronimoSchema(...) and can't seem to figure out 
why... Perhaps you can shed some light?

I start with the following hand written plan...

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.0" 
configId="test/test">
  <context-root>/test</context-root>
  <context-priority-classloader>false</context-priority-classloader>
  <resource-env-ref>
    <ref-name>blah</ref-name>
    <message-destination-link>blah</message-destination-link>
  </resource-env-ref>
</web-app>


I then call the following snippet of code...


XmlObject plan = XmlBeansUtil.parse(dpFile.getLocation().toFile().toURL());
WebAppDocument webDoc = (WebAppDocument) 
plan.changeType(WebAppDocument.type);
WebAppType web = (WebAppType) 
SchemaConversionUtils.fixGeronimoSchema(webDoc, "web-app", 
WebAppDocument.type);


The following exception is thrown although the converted plan in the 
exception seems to be correct...

org.apache.xmlbeans.XmlException: Invalid deployment descriptor: [error: 
cvc-complex-type.3.2.1: Attribute not allowed (no wildcards allowed): 
configId, error: cvc-complex-type.2.4a: Expected element 
'web-app@http://java.sun.com/xml/ns/j2ee' instead of 
'context-root@http://geronimo.apache.org/xml/ns/j2ee/web-1.0' here, 
error: cvc-complex-type.2.4a: Expected element 
'web-app@http://java.sun.com/xml/ns/j2ee' instead of 
'context-priority-classloader@http://geronimo.apache.org/xml/ns/j2ee/web-1.0' 
here, error: cvc-complex-type.2.4a: Expected element 
'web-app@http://java.sun.com/xml/ns/j2ee' instead of 
'resource-env-ref@http://geronimo.apache.org/xml/ns/naming-1.0' here, 
error: cvc-complex-type.2.4c: Expected element 
'web-app@http://java.sun.com/xml/ns/j2ee' before the end of the content]

Descriptor: <xml-fragment configId="test/test" 
xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-1.0" 
xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.0">
  <web:context-root>/test</web:context-root>
  <web:context-priority-classloader>false</web:context-priority-classloader>
  <nam:resource-env-ref>
    <nam:ref-name>blah</nam:ref-name>
    <nam:message-destination-link>blah</nam:message-destination-link>
  </nam:resource-env-ref>
</xml-fragment>
   
at 
org.apache.geronimo.schema.SchemaConversionUtils.validateDD(SchemaConversionUtils.java:594)
    at 
org.apache.geronimo.schema.SchemaConversionUtils.fixGeronimoSchema(SchemaConversionUtils.java:360)

Any ideas as to what is wrong?

Thanks,

Sachin

David Jencks wrote:
>
> On Oct 11, 2005, at 6:04 PM, Sachin Patel wrote:
>
>>
>> David Jencks wrote:
>>>
>>>
>>> I'd have the issue say that the eclipse stuff should pre-convert the 
>>> plans using SchemaConversionUtils.  We'll find out soon enough what 
>>> needs to change :-)  Is there an easy to find point in the eclipse 
>>> stuff where you know what kind of plan it is and want to convert it?
>> Well when importing a J2EE app or module into WTP a new 
>> "project/component" is always created for every module in that 
>> application and so I'll know every module type and thus should 
>> automatically know the j2ee plan type during the import.  This import 
>> operation is extendable and I'll be able to do this conversion then 
>> for every module.  (With nested plans, it may be a little tricker, 
>> will have to put some thought into that...)
>
> An ear plan always has namespaces for the plans for the modules.  They 
> could be the old unversioned namespaces (missing -1.0 at the end) but 
> they are sufficient to identify what you should end up with.  The web 
> plans are a little trickier, since after figuring out which builder we 
> will use the generic geronimo-web docs are converted to 
> container-specific docs.  Are you planning to generate generic web 
> plans or container specific web plans or give the user a choice?
>
> An ear plan will still need some namespace conversion to get the 
> dependencies and gbeans.
>
> thanks
> david jencks
>
>

Re: [Fwd: Re: rid of all ns prefixes]

Posted by Sachin Patel <sp...@gmail.com>.

David Jencks wrote:
>
> On Oct 11, 2005, at 6:04 PM, Sachin Patel wrote:
>
>>
>> David Jencks wrote:
>>>
>>>
>>> I'd have the issue say that the eclipse stuff should pre-convert the 
>>> plans using SchemaConversionUtils.  We'll find out soon enough what 
>>> needs to change :-)  Is there an easy to find point in the eclipse 
>>> stuff where you know what kind of plan it is and want to convert it?
>> Well when importing a J2EE app or module into WTP a new 
>> "project/component" is always created for every module in that 
>> application and so I'll know every module type and thus should 
>> automatically know the j2ee plan type during the import.  This import 
>> operation is extendable and I'll be able to do this conversion then 
>> for every module.  (With nested plans, it may be a little tricker, 
>> will have to put some thought into that...)
>
> An ear plan always has namespaces for the plans for the modules.  They 
> could be the old unversioned namespaces (missing -1.0 at the end) but 
> they are sufficient to identify what you should end up with.  The web 
> plans are a little trickier, since after figuring out which builder we 
> will use the generic geronimo-web docs are converted to 
> container-specific docs.  Are you planning to generate generic web 
> plans or container specific web plans or give the user a choice?
For now probably just generic web plans, but eventually it would be nice 
to provide a choice to choose a container specific plan.
>
> An ear plan will still need some namespace conversion to get the 
> dependencies and gbeans.
>
> thanks
> david jencks
>
>

Re: [Fwd: Re: rid of all ns prefixes]

Posted by David Jencks <da...@yahoo.com>.
On Oct 11, 2005, at 6:04 PM, Sachin Patel wrote:

>
> David Jencks wrote:
>>
>>
>> I'd have the issue say that the eclipse stuff should pre-convert the 
>> plans using SchemaConversionUtils.  We'll find out soon enough what 
>> needs to change :-)  Is there an easy to find point in the eclipse 
>> stuff where you know what kind of plan it is and want to convert it?
> Well when importing a J2EE app or module into WTP a new 
> "project/component" is always created for every module in that 
> application and so I'll know every module type and thus should 
> automatically know the j2ee plan type during the import.  This import 
> operation is extendable and I'll be able to do this conversion then 
> for every module.  (With nested plans, it may be a little tricker, 
> will have to put some thought into that...)

An ear plan always has namespaces for the plans for the modules.  They 
could be the old unversioned namespaces (missing -1.0 at the end) but 
they are sufficient to identify what you should end up with.  The web 
plans are a little trickier, since after figuring out which builder we 
will use the generic geronimo-web docs are converted to 
container-specific docs.  Are you planning to generate generic web 
plans or container specific web plans or give the user a choice?

An ear plan will still need some namespace conversion to get the 
dependencies and gbeans.

thanks
david jencks


Re: [Fwd: Re: rid of all ns prefixes]

Posted by Sachin Patel <sp...@gmail.com>.
David Jencks wrote:
>
>
> I'd have the issue say that the eclipse stuff should pre-convert the 
> plans using SchemaConversionUtils.  We'll find out soon enough what 
> needs to change :-)  Is there an easy to find point in the eclipse 
> stuff where you know what kind of plan it is and want to convert it?
Well when importing a J2EE app or module into WTP a new 
"project/component" is always created for every module in that 
application and so I'll know every module type and thus should 
automatically know the j2ee plan type during the import.  This import 
operation is extendable and I'll be able to do this conversion then for 
every module.  (With nested plans, it may be a little tricker, will have 
to put some thought into that...)

Sachin.

Re: [Fwd: Re: rid of all ns prefixes]

Posted by David Jencks <da...@yahoo.com>.
On Oct 11, 2005, at 5:45 PM, Sachin Patel wrote:

> David Jencks wrote:
>> I'm a bit unclear as to whether the eclipse stuff you are working on 
>> is supposed to be able to edit hand written plans or is only supposed 
>> to be able to generate new plans.
> Ideally both.  Existing geronimo applications should be able to be 
> imported into WTP and the editors should be able to open the hand 
> written plans.
>
>> In the latter  case, you can just generate plans including the 
>> correct namespaces.  In the former case, you should call the 
>> appropriate methods in SchemaConversionUtils to set the correct 
>> namespaces before trying to import into your tool.  Most likely we 
>> will need to change things a bit so this can be done conveniently.
>
> Cool ok.  So can the conversion be done both ways? That way in the 
> "source tab" of the editor I could possibly show the "hand written 
> version" while the graphical editors would be writing and modifying 
> the underlying EMF model.  Should I go ahead and open a jira up to 
> track this work on ScheamConversionUtils for 1.0?

I don't think it is worth preserving the namespace-free version, and I 
have no idea how to go backwards.  I think setting the correct 
namespace and saving is adequate.  The primary reason for the 
namespace-free stuff is to avoid making people type them in themselves. 
  If we can add them automatically, all the better.

I'd have the issue say that the eclipse stuff should pre-convert the 
plans using SchemaConversionUtils.  We'll find out soon enough what 
needs to change :-)  Is there an easy to find point in the eclipse 
stuff where you know what kind of plan it is and want to convert it?

thanks
david jencks


Re: [Fwd: Re: rid of all ns prefixes]

Posted by Sachin Patel <sp...@gmail.com>.
David Jencks wrote:
> I'm a bit unclear as to whether the eclipse stuff you are working on 
> is supposed to be able to edit hand written plans or is only supposed 
> to be able to generate new plans.  
Ideally both.  Existing geronimo applications should be able to be 
imported into WTP and the editors should be able to open the hand 
written plans.

> In the latter  case, you can just generate plans including the correct 
> namespaces.  In the former case, you should call the appropriate 
> methods in SchemaConversionUtils to set the correct namespaces before 
> trying to import into your tool.  Most likely we will need to change 
> things a bit so this can be done conveniently.

Cool ok.  So can the conversion be done both ways? That way in the 
"source tab" of the editor I could possibly show the "hand written 
version" while the graphical editors would be writing and modifying the 
underlying EMF model.  Should I go ahead and open a jira up to track 
this work on ScheamConversionUtils for 1.0?

Sachin.
>
> thanks
> david jencks
>
>>
>> Sachin.
>>
>> -------- Original Message --------
>> Subject: Re: rid of all ns prefixes
>> Date: Tue, 11 Oct 2005 12:56:09 -0600
>> From: Dave Carlson <dc...@xmlmodeling.com>
>> Organization: XMLmodeling.com
>> Newsgroups: eclipse.tools.emf
>> References: <di...@news.eclipse.org> 
>> <di...@news.eclipse.org> <di...@news.eclipse.org>
>>
>> The XML spec does not require a schema for well-formed XML 
>> documents.  From
>> your description, it sounds like Geronimo has written a custom 
>> application
>> that "knows" how to load the XML stream without reference to any 
>> schemas.
>> Unfortunately, it is impossible to use a general purpose modeling 
>> tool like
>> EMF (or any other Java-binding framework) without well-defined 
>> schemas and
>> their required namespaces/prefixes.
>>
>> "Sachin Patel" <sp...@gmail.com> wrote in message
>> news:digu6l$3ml$1@news.eclipse.org...
>>> What I'm generating is the server specific deployment descriptors 
>>> for Apache Geronimo.  I see what you are saying, and I'm not sure 
>>> exactly how the server is able to load the plans without the 
>>> namespace declarations, but when creating these plans for Geronimo, 
>>> the elements without being qualified are able to be loaded and 
>>> processed by the server.  Will post on their dev list on how exactly 
>>> they are accomplishing this, but I would like to take those existing 
>>> plans from there "samples" which contain contain no qualified 
>>> elements and be able to load and parse them with my EMF model.
>>>
>>> So its more of a compatibility reason for which I need to be able to 
>>> do this.  The sample applications in geronimo should be able to be 
>>> imported into WTP and be processed my EMF model which are based on 
>>> the same exact schemas.  But the xml files in these sample 
>>> applications do not contain fully qualified elements.
>>>
>>>
>>
>>
>
>

Re: [Fwd: Re: rid of all ns prefixes]

Posted by David Jencks <da...@yahoo.com>.
On Oct 11, 2005, at 12:07 PM, Sachin Patel wrote:

> Is the following statement true??

not really.
> How is geronimo being able to process deployment plans without 
> declaring all namespaces in a plan and qualifying the elements?

well, you have surely seen that there is always a top level schema at 
least.  I use some xmlbeans XmlCursor manipulation to change the 
namespace of recognized subelements that are supposed to be in other 
namespaces before loading the document into XmlObjects.  By the time 
the XmlObjects are constructed the document is fully valid according to 
the plan schemas.  All this namespace conversion code is in 
SchemaConversionUtils. (there is some other conversion code in a couple 
jetty/tomcat builder classes, but lets talk about that later).  I'm a 
bit unclear as to whether the eclipse stuff you are working on is 
supposed to be able to edit hand written plans or is only supposed to 
be able to generate new plans.  In the latter  case, you can just 
generate plans including the correct namespaces.  In the former case, 
you should call the appropriate methods in SchemaConversionUtils to set 
the correct namespaces before trying to import into your tool.  Most 
likely we will need to change things a bit so this can be done 
conveniently.

thanks
david jencks

>
> Sachin.
>
> -------- Original Message --------
> Subject: Re: rid of all ns prefixes
> Date: Tue, 11 Oct 2005 12:56:09 -0600
> From: Dave Carlson <dc...@xmlmodeling.com>
> Organization: XMLmodeling.com
> Newsgroups: eclipse.tools.emf
> References: <di...@news.eclipse.org> 
> <di...@news.eclipse.org> <di...@news.eclipse.org>
>
> The XML spec does not require a schema for well-formed XML documents.  
> From
> your description, it sounds like Geronimo has written a custom 
> application
> that "knows" how to load the XML stream without reference to any 
> schemas.
> Unfortunately, it is impossible to use a general purpose modeling tool 
> like
> EMF (or any other Java-binding framework) without well-defined schemas 
> and
> their required namespaces/prefixes.
>
> "Sachin Patel" <sp...@gmail.com> wrote in message
> news:digu6l$3ml$1@news.eclipse.org...
>> What I'm generating is the server specific deployment descriptors for 
>> Apache Geronimo.  I see what you are saying, and I'm not sure exactly 
>> how the server is able to load the plans without the namespace 
>> declarations, but when creating these plans for Geronimo, the 
>> elements without being qualified are able to be loaded and processed 
>> by the server.  Will post on their dev list on how exactly they are 
>> accomplishing this, but I would like to take those existing plans 
>> from there "samples" which contain contain no qualified elements and 
>> be able to load and parse them with my EMF model.
>>
>> So its more of a compatibility reason for which I need to be able to 
>> do this.  The sample applications in geronimo should be able to be 
>> imported into WTP and be processed my EMF model which are based on 
>> the same exact schemas.  But the xml files in these sample 
>> applications do not contain fully qualified elements.
>>
>>
>
>