Hi,

I'm defining an xsd which defines a restriction on topic. I include a
portion of that here:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
elementFormDefault="unqualified"
  targetNamespace="http://docbook.org/ns/docbook"; xmlns:db="
http://docbook.org/ns/docbook"; xmlns="http://docbook.org/ns/docbook";
  xmlns:xlink="http://www.w3.org/1999/xlink";>

  <xs:import namespace="http://www.w3.org/1999/xlink";
schemaLocation="xlink.xsd"/>
  <xs:import namespace="http://www.w3.org/XML/1998/namespace";
schemaLocation="xml.xsd"/>

  <xs:element name="topic">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="db:info"/>
          <xs:element maxOccurs="unbounded" ref="db:para"/>
      </xs:sequence>
      <xs:attribute ref="db:metaref"/>
      <xs:attribute ref="db:role"/>
      <xs:attribute ref="xml:id" use="required"/>
    </xs:complexType>
  </xs:element>

 <xs:element name="para">
    <xs:complexType mixed="true">
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="db:emphasis"/>
        <xs:element ref="db:phrase"/>
      </xs:choice>
      <xs:attribute ref="db:metaref"/>
      <xs:attribute ref="db:role"/>
      <xs:attribute ref="xml:id"/>
    </xs:complexType>
  </xs:element>

...

The thing that I'm having trouble with is creating an output that does
require the db: prefix on the attributes such as db:role db:metaref.  I've
tried amoung other approaches removing the db: prefix from the xsd but
things don't work out that way either.

It would be nice if the content validated against the DKCO.rnc as well
which doesn't need the db:prefix

<?xml version="1.0" encoding="UTF-8"?>

<topic xmlns:xlink="http://www.w3.org/1999/xlink";  xmlns:db="
http://docbook.org/ns/docbook"; xmlns="http://docbook.org/ns/docbook";
xml:id="T1">
    <info>
        <title>Title</title>
    </info>

    <para db:role="XYZ" xml:id="T2">
        <phrase db:metaref="category">Location</phrase>
    </para>
</topic>


Thoughts?

Thanks


-- 
-

Alex Muir
http://ca.linkedin.com/pub/alex-muir/36/ab7/125

Reply via email to