[Dev] XML Developer's on the list

Kevin Sonney dev@trilug.org
23 Jun 2002 22:26:38 -0400


--=-uylGzmI25oyvGFecothY
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Sun, 2002-06-23 at 12:17, Tom Bryan wrote:
> I'd like the roles to be validated by the XML parser, but the set of=20
> valid roles varies depending upon which customer is using the software.=20

Hmm. that can make things tricky.

> Is there a way to do this without having a completely different version o=
f the=20
> schema at each customer site?  Am I stuck with using xsd:string for the r=
ole=20
> attribute and doing all of the validation in the code (driven by a=20
> site-specific properties file)?  Would you somehow separate out the porti=
ons=20
> that change per customer and let those responsible for installing the sys=
tem=20
> tweak the customer-specific portions of the schema?

I expect you'll need an xml schema per site if they don't all share the
same role information. One thing that could make this really do-able,
though, is the use of name spaces in your data,  like so:

<?xml version=3D"1.0">
<roles xmlns:sitea=3D"http://sitea.org/schema"
       xmlns:siteb=3D"http://siteb.com/schema"
>
  <sitea:customerinfo>
      <sitea:customer name=3D"foo"/>
          <sitea:info>DATA</sitea:info>
      </sites:customer>
  </sitea:customerinfo>
  <siteb:customerdata>
      <siteb:customer name=3D"bar"/>
          <siteb:custinfo>DATA2</sitea:custinfo>
      </siteb:customerdata>
  </siteb:cusotmerdata>
</roles>

Each site has it's own name space, and can define their own schema as
needed.=20

You probably aught to read the spec at
http://www.w3.org/TR/REC-xml-names/ for complete information.....

--=20
----------------------------------
--         Kevin Sonney         --
--  ICQ: 4855069  AIM: ksonney  --
----------------------------------
320C 0336 3BC4 13EC 4AEC  6AF2 525F CED7 7BB6 12C9
 Crispy Fries -- Neil, http://www.goats.com

--=-uylGzmI25oyvGFecothY
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA9FoNeUl/O13u2EskRAkJYAJ9Y9EivmrcISCkGz5Xz3woAImE+JACfTSiy
uAU0JJcKzatg0fL+QIE6sNY=
=0G3g
-----END PGP SIGNATURE-----

--=-uylGzmI25oyvGFecothY--