473,378 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

allow any child element in

I want to create an xsd so that I can validate xml against it. All I care
is that the root node (named brl) exists in the document. Any other node
can go inside it. If I validate an xml file with just the brl node it
validates fine, but if I put other elements in I get errors. How can I
change the xsd so that any child elements/attributes of brl validate ok,
without having to explicitly declare them in the xsd? (I've included my
xml, xsd and the errors below)

XSD:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003"
targetNamespace="http://schemas.microsoft.com/businessruleslanguage/2002"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="brl" type="xs:anyType">
<xs:annotation>
<xs:documentation>Business Rules Engine Deployment
File</xs:documentation>
</xs:annotation>
</xs:element>
</xs:schema>

XML:
<?xml version="1.0" encoding="utf-8"?>
<brl xmlns="http://schemas.microsoft.com/businessruleslanguage/2002">
<ruleset name="InteriorHealth.Orchestrations.InterRaiADT.Ro uteFilter">
<version major="1" minor="0" description="" modifiedby="IHA\chaj17"
date="2005-09-26T16:40:45.6215718-07:00" />

</ruleset>
</brl>

Errors:
The 'http://schemas.microsoft.com/businessruleslanguage/2002:ruleset'
element is not declared. An error occurred at , (3, 4).
Could not find schema information for the attribute 'name'. An error
occurred at , (3, 12).
The 'http://schemas.microsoft.com/businessruleslanguage/2002:version'
element is not declared. An error occurred at , (4, 6).
Could not find schema information for the attribute 'major'. An error
occurred at , (4, 14).
Could not find schema information for the attribute 'minor'. An error
occurred at , (4, 24).
Could not find schema information for the attribute 'description'. An error
occurred at , (4, 34).
Could not find schema information for the attribute 'modifiedby'. An error
occurred at , (4, 49).
Could not find schema information for the attribute 'date'. An error
occurred at , (4, 73).
Nov 12 '05 #1
1 1903
Hello!
I want to create an xsd so that I can validate xml against it. All I care
is that the root node (named brl) exists in the document. Any other node
can go inside it.

Try xs:any

<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" ... />
</xs:sequence>

It is also possible to restrict the namespace of xs:any
<xs:any namespace="urn:ns1 urn:ns2" />
See: <http://www.w3.org/TR/xmlschema-1/#Wildcard>
--
Pascal Schmitt
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Robert Zurer | last post by:
I want to create a schema element that will allow any element as a child but that child must contain specified attributes This example doesn't work but it might give an idea of what I need to do....
1
by: George W. | last post by:
Okay, I'm a C#/XML newbie, and I've been wrestling with this for a while now, checked dotnet sites, articles, MSDN Library, etc. and haven't been able to determine why this is happening. I have...
4
by: patrizio.trinchini | last post by:
Hi all, I'm new to XSLT and maybe my problem have a very trivial answer, but I need an expert that point me in the right direction. What I would obtain is to remove all the elements that have a...
2
by: Claudia Fong | last post by:
Hi, I have a xml document which is like this: <profile document> <Child name = profile1 id = 1> </Child> </profile document>
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.