[xml] libxml2 behaves differently on actual <attribute> vs attribute inserted using <ref>

Hi all,

I used <ref> to reference a predefined attribute in my Relax NG schema,
but I received this error from libxml2:

     "Invalid attribute Title for element Book"

See below schema and xml snippets (notice the <ref name="TitleAttribute"/>
under "Book" element.

I did not get the same error if I directly specify the <attribute>
under "Book", i.e: without using <ref>.

Anyone know why this is the case or what I'm missing?

Any help/comment is very much appreciated.


=========== test.rng ====================
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
    <element name="Book">
      <ref name="TitleAttribute"/>  <!-- NOTE: I think using ref here generates error. -->
          <element name="Author">

  <define name="TitleAttribute">
    <attribute name="Title">
      <data type="token"/>


=============== test.xml =========================

<Book Title="History101">
  <Author>Joe Joe</Author>
  <Author>Jill Jill</Author>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]