Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Use schema to valid data field where code values are stored in another xml document >Thread Next - Re: Use schema to valid data field where code values are stored in another xml document Re: Use schema to valid data field where code values are stored in another xml documentTo: NULL Date: 4/5/2007 1:08:00 PM "Harlz" <nospam@n...> wrote in message news:eoEcFG6dHHA.2332@T...... >I have a xml spec I created for an order entry process. I'm validating the > xml against a schema (xsd). One of the fields in the xml spec is a > product > code. I have another xml document that lists the product codes with a > description of the products. I want the schema to import the product > codes > xml document and validate the product code field against these codes from > the product data xml document. My reason is if I add or change products > I > only have to modify the product code xml document. I'm not even sure if > this is possible any one know if this is possible. One XML schema can import or include another. If you put your product code file into the format for an XML schema, then your main schema could import it. If it's not an XML schema, then another XML schema cannot use it. Also, how many product codes are there? If there are many, then your schema could become quite large and inefficient. You might consider leaving product code validation out of the schema, and instead, validate it in code, using the product code file. If you _really_ want to do it "the XML way", then you could create an XSL stylesheet which references the product code file using the "document" function. John | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
