You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Claude Warren <cl...@xenei.com> on 2016/11/19 23:52:04 UTC

namespaces in XML configurations

I am attempting to use configuration2 for the first time and have run into
what I think is a bug.

{noformat}
<h:html xmlns:xdc="http://www.xml.com/books"
        xmlns:h="http://www.w3.org/HTML/1998/html4"
        xmlns:x='http://xenei.org'>
 <h:head><h:title>Book Review</h:title></h:head>
 <h:body>
  <xdc:bookreview>
   <x:yoo>hoo</x:yoo>
   <xdc:title>XML: A Primer</xdc:title>
   <h:table>
    <h:tr align="center">
     <h:td>Author</h:td><h:td>Price</h:td>
     <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
    <h:tr align="left">
     <h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
     <h:td><xdc:price>31.98</xdc:price></h:td>
     <h:td><xdc:pages>352</xdc:pages></h:td>
     <h:td><xdc:date>1998/01</xdc:date></h:td>
    </h:tr>
   </h:table>
  </xdc:bookreview>
 </h:body>
</h:html>
{noformat}

will parse but

{noformat}
<h:html xmlns:xdc="http://www.xml.com/books"
        xmlns:h="http://www.w3.org/HTML/1998/html4">
 <h:head xmlns:x='http://xenei.org'><h:title>Book Review</h:title></h:head>
 <h:body>
  <xdc:bookreview>
   <x:yoo>hoo</x:yoo>
   <xdc:title>XML: A Primer</xdc:title>
   <h:table>
    <h:tr align="center">
     <h:td>Author</h:td><h:td>Price</h:td>
     <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
    <h:tr align="left">
     <h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
     <h:td><xdc:price>31.98</xdc:price></h:td>
     <h:td><xdc:pages>352</xdc:pages></h:td>
     <h:td><xdc:date>1998/01</xdc:date></h:td>
    </h:tr>
   </h:table>
  </xdc:bookreview>
 </h:body>
</h:html>
{noformat}

will not.

Note the only difference is  that the namespace for "x" is not declared on
the first element.  Is this a bug or intended?

Claude


-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: namespaces in XML configurations

Posted by Matt Sicker <bo...@gmail.com>.
Whoops, I didn't even notice that!

On 20 November 2016 at 08:06, Claude Warren <cl...@xenei.com> wrote:

> @sebb
>
> good catch.
>
> On Sun, Nov 20, 2016 at 1:33 PM, sebb <se...@gmail.com> wrote:
>
> > It may be valid XML, but AFAICT the scope of a namespace is the
> > enclosing element.
> >
> > So 'x' is only defined in the head, but is being used in the body.
> >
> > Try what happens when the namespace is defined and used only in the
> > body element.
> >
> >
> > On 20 November 2016 at 00:34, Matt Sicker <bo...@gmail.com> wrote:
> > > Considering that's valid XML, that certainly sounds like a bug. Could
> you
> > > file an issue on jira for it?
> > > https://issues.apache.org/jira/browse/CONFIGURATION
> > >
> > > On 19 November 2016 at 17:52, Claude Warren <cl...@xenei.com> wrote:
> > >
> > >> I am attempting to use configuration2 for the first time and have run
> > into
> > >> what I think is a bug.
> > >>
> > >> {noformat}
> > >> <h:html xmlns:xdc="http://www.xml.com/books"
> > >>         xmlns:h="http://www.w3.org/HTML/1998/html4"
> > >>         xmlns:x='http://xenei.org'>
> > >>  <h:head><h:title>Book Review</h:title></h:head>
> > >>  <h:body>
> > >>   <xdc:bookreview>
> > >>    <x:yoo>hoo</x:yoo>
> > >>    <xdc:title>XML: A Primer</xdc:title>
> > >>    <h:table>
> > >>     <h:tr align="center">
> > >>      <h:td>Author</h:td><h:td>Price</h:td>
> > >>      <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
> > >>     <h:tr align="left">
> > >>      <h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
> > >>      <h:td><xdc:price>31.98</xdc:price></h:td>
> > >>      <h:td><xdc:pages>352</xdc:pages></h:td>
> > >>      <h:td><xdc:date>1998/01</xdc:date></h:td>
> > >>     </h:tr>
> > >>    </h:table>
> > >>   </xdc:bookreview>
> > >>  </h:body>
> > >> </h:html>
> > >> {noformat}
> > >>
> > >> will parse but
> > >>
> > >> {noformat}
> > >> <h:html xmlns:xdc="http://www.xml.com/books"
> > >>         xmlns:h="http://www.w3.org/HTML/1998/html4">
> > >>  <h:head xmlns:x='http://xenei.org'><h:title>Book
> > >> Review</h:title></h:head>
> > >>  <h:body>
> > >>   <xdc:bookreview>
> > >>    <x:yoo>hoo</x:yoo>
> > >>    <xdc:title>XML: A Primer</xdc:title>
> > >>    <h:table>
> > >>     <h:tr align="center">
> > >>      <h:td>Author</h:td><h:td>Price</h:td>
> > >>      <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
> > >>     <h:tr align="left">
> > >>      <h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
> > >>      <h:td><xdc:price>31.98</xdc:price></h:td>
> > >>      <h:td><xdc:pages>352</xdc:pages></h:td>
> > >>      <h:td><xdc:date>1998/01</xdc:date></h:td>
> > >>     </h:tr>
> > >>    </h:table>
> > >>   </xdc:bookreview>
> > >>  </h:body>
> > >> </h:html>
> > >> {noformat}
> > >>
> > >> will not.
> > >>
> > >> Note the only difference is  that the namespace for "x" is not
> declared
> > on
> > >> the first element.  Is this a bug or intended?
> > >>
> > >> Claude
> > >>
> > >>
> > >> --
> > >> I like: Like Like - The likeliest place on the web
> > >> <http://like-like.xenei.com>
> > >> LinkedIn: http://www.linkedin.com/in/claudewarren
> > >>
> > >
> > >
> > >
> > > --
> > > Matt Sicker <bo...@gmail.com>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> > For additional commands, e-mail: user-help@commons.apache.org
> >
> >
>
>
> --
> I like: Like Like - The likeliest place on the web
> <http://like-like.xenei.com>
> LinkedIn: http://www.linkedin.com/in/claudewarren
>



-- 
Matt Sicker <bo...@gmail.com>

Re: namespaces in XML configurations

Posted by Claude Warren <cl...@xenei.com>.
@sebb

good catch.

On Sun, Nov 20, 2016 at 1:33 PM, sebb <se...@gmail.com> wrote:

> It may be valid XML, but AFAICT the scope of a namespace is the
> enclosing element.
>
> So 'x' is only defined in the head, but is being used in the body.
>
> Try what happens when the namespace is defined and used only in the
> body element.
>
>
> On 20 November 2016 at 00:34, Matt Sicker <bo...@gmail.com> wrote:
> > Considering that's valid XML, that certainly sounds like a bug. Could you
> > file an issue on jira for it?
> > https://issues.apache.org/jira/browse/CONFIGURATION
> >
> > On 19 November 2016 at 17:52, Claude Warren <cl...@xenei.com> wrote:
> >
> >> I am attempting to use configuration2 for the first time and have run
> into
> >> what I think is a bug.
> >>
> >> {noformat}
> >> <h:html xmlns:xdc="http://www.xml.com/books"
> >>         xmlns:h="http://www.w3.org/HTML/1998/html4"
> >>         xmlns:x='http://xenei.org'>
> >>  <h:head><h:title>Book Review</h:title></h:head>
> >>  <h:body>
> >>   <xdc:bookreview>
> >>    <x:yoo>hoo</x:yoo>
> >>    <xdc:title>XML: A Primer</xdc:title>
> >>    <h:table>
> >>     <h:tr align="center">
> >>      <h:td>Author</h:td><h:td>Price</h:td>
> >>      <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
> >>     <h:tr align="left">
> >>      <h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
> >>      <h:td><xdc:price>31.98</xdc:price></h:td>
> >>      <h:td><xdc:pages>352</xdc:pages></h:td>
> >>      <h:td><xdc:date>1998/01</xdc:date></h:td>
> >>     </h:tr>
> >>    </h:table>
> >>   </xdc:bookreview>
> >>  </h:body>
> >> </h:html>
> >> {noformat}
> >>
> >> will parse but
> >>
> >> {noformat}
> >> <h:html xmlns:xdc="http://www.xml.com/books"
> >>         xmlns:h="http://www.w3.org/HTML/1998/html4">
> >>  <h:head xmlns:x='http://xenei.org'><h:title>Book
> >> Review</h:title></h:head>
> >>  <h:body>
> >>   <xdc:bookreview>
> >>    <x:yoo>hoo</x:yoo>
> >>    <xdc:title>XML: A Primer</xdc:title>
> >>    <h:table>
> >>     <h:tr align="center">
> >>      <h:td>Author</h:td><h:td>Price</h:td>
> >>      <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
> >>     <h:tr align="left">
> >>      <h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
> >>      <h:td><xdc:price>31.98</xdc:price></h:td>
> >>      <h:td><xdc:pages>352</xdc:pages></h:td>
> >>      <h:td><xdc:date>1998/01</xdc:date></h:td>
> >>     </h:tr>
> >>    </h:table>
> >>   </xdc:bookreview>
> >>  </h:body>
> >> </h:html>
> >> {noformat}
> >>
> >> will not.
> >>
> >> Note the only difference is  that the namespace for "x" is not declared
> on
> >> the first element.  Is this a bug or intended?
> >>
> >> Claude
> >>
> >>
> >> --
> >> I like: Like Like - The likeliest place on the web
> >> <http://like-like.xenei.com>
> >> LinkedIn: http://www.linkedin.com/in/claudewarren
> >>
> >
> >
> >
> > --
> > Matt Sicker <bo...@gmail.com>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>


-- 
I like: Like Like - The likeliest place on the web
<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren

Re: namespaces in XML configurations

Posted by sebb <se...@gmail.com>.
It may be valid XML, but AFAICT the scope of a namespace is the
enclosing element.

So 'x' is only defined in the head, but is being used in the body.

Try what happens when the namespace is defined and used only in the
body element.


On 20 November 2016 at 00:34, Matt Sicker <bo...@gmail.com> wrote:
> Considering that's valid XML, that certainly sounds like a bug. Could you
> file an issue on jira for it?
> https://issues.apache.org/jira/browse/CONFIGURATION
>
> On 19 November 2016 at 17:52, Claude Warren <cl...@xenei.com> wrote:
>
>> I am attempting to use configuration2 for the first time and have run into
>> what I think is a bug.
>>
>> {noformat}
>> <h:html xmlns:xdc="http://www.xml.com/books"
>>         xmlns:h="http://www.w3.org/HTML/1998/html4"
>>         xmlns:x='http://xenei.org'>
>>  <h:head><h:title>Book Review</h:title></h:head>
>>  <h:body>
>>   <xdc:bookreview>
>>    <x:yoo>hoo</x:yoo>
>>    <xdc:title>XML: A Primer</xdc:title>
>>    <h:table>
>>     <h:tr align="center">
>>      <h:td>Author</h:td><h:td>Price</h:td>
>>      <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
>>     <h:tr align="left">
>>      <h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
>>      <h:td><xdc:price>31.98</xdc:price></h:td>
>>      <h:td><xdc:pages>352</xdc:pages></h:td>
>>      <h:td><xdc:date>1998/01</xdc:date></h:td>
>>     </h:tr>
>>    </h:table>
>>   </xdc:bookreview>
>>  </h:body>
>> </h:html>
>> {noformat}
>>
>> will parse but
>>
>> {noformat}
>> <h:html xmlns:xdc="http://www.xml.com/books"
>>         xmlns:h="http://www.w3.org/HTML/1998/html4">
>>  <h:head xmlns:x='http://xenei.org'><h:title>Book
>> Review</h:title></h:head>
>>  <h:body>
>>   <xdc:bookreview>
>>    <x:yoo>hoo</x:yoo>
>>    <xdc:title>XML: A Primer</xdc:title>
>>    <h:table>
>>     <h:tr align="center">
>>      <h:td>Author</h:td><h:td>Price</h:td>
>>      <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
>>     <h:tr align="left">
>>      <h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
>>      <h:td><xdc:price>31.98</xdc:price></h:td>
>>      <h:td><xdc:pages>352</xdc:pages></h:td>
>>      <h:td><xdc:date>1998/01</xdc:date></h:td>
>>     </h:tr>
>>    </h:table>
>>   </xdc:bookreview>
>>  </h:body>
>> </h:html>
>> {noformat}
>>
>> will not.
>>
>> Note the only difference is  that the namespace for "x" is not declared on
>> the first element.  Is this a bug or intended?
>>
>> Claude
>>
>>
>> --
>> I like: Like Like - The likeliest place on the web
>> <http://like-like.xenei.com>
>> LinkedIn: http://www.linkedin.com/in/claudewarren
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: namespaces in XML configurations

Posted by Matt Sicker <bo...@gmail.com>.
Considering that's valid XML, that certainly sounds like a bug. Could you
file an issue on jira for it?
https://issues.apache.org/jira/browse/CONFIGURATION

On 19 November 2016 at 17:52, Claude Warren <cl...@xenei.com> wrote:

> I am attempting to use configuration2 for the first time and have run into
> what I think is a bug.
>
> {noformat}
> <h:html xmlns:xdc="http://www.xml.com/books"
>         xmlns:h="http://www.w3.org/HTML/1998/html4"
>         xmlns:x='http://xenei.org'>
>  <h:head><h:title>Book Review</h:title></h:head>
>  <h:body>
>   <xdc:bookreview>
>    <x:yoo>hoo</x:yoo>
>    <xdc:title>XML: A Primer</xdc:title>
>    <h:table>
>     <h:tr align="center">
>      <h:td>Author</h:td><h:td>Price</h:td>
>      <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
>     <h:tr align="left">
>      <h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
>      <h:td><xdc:price>31.98</xdc:price></h:td>
>      <h:td><xdc:pages>352</xdc:pages></h:td>
>      <h:td><xdc:date>1998/01</xdc:date></h:td>
>     </h:tr>
>    </h:table>
>   </xdc:bookreview>
>  </h:body>
> </h:html>
> {noformat}
>
> will parse but
>
> {noformat}
> <h:html xmlns:xdc="http://www.xml.com/books"
>         xmlns:h="http://www.w3.org/HTML/1998/html4">
>  <h:head xmlns:x='http://xenei.org'><h:title>Book
> Review</h:title></h:head>
>  <h:body>
>   <xdc:bookreview>
>    <x:yoo>hoo</x:yoo>
>    <xdc:title>XML: A Primer</xdc:title>
>    <h:table>
>     <h:tr align="center">
>      <h:td>Author</h:td><h:td>Price</h:td>
>      <h:td>Pages</h:td><h:td>Date</h:td></h:tr>
>     <h:tr align="left">
>      <h:td><xdc:author>Simon St. Laurent</xdc:author></h:td>
>      <h:td><xdc:price>31.98</xdc:price></h:td>
>      <h:td><xdc:pages>352</xdc:pages></h:td>
>      <h:td><xdc:date>1998/01</xdc:date></h:td>
>     </h:tr>
>    </h:table>
>   </xdc:bookreview>
>  </h:body>
> </h:html>
> {noformat}
>
> will not.
>
> Note the only difference is  that the namespace for "x" is not declared on
> the first element.  Is this a bug or intended?
>
> Claude
>
>
> --
> I like: Like Like - The likeliest place on the web
> <http://like-like.xenei.com>
> LinkedIn: http://www.linkedin.com/in/claudewarren
>



-- 
Matt Sicker <bo...@gmail.com>