473,804 Members | 2,989 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlSchema Element with Namespace/Qualified Name

hi.

--short version--
i have an .xsd file (XML Schema). It has many elements in it (tags).

Sometimes, my application wants to know everything there is to know
(attributes, constraints, etc) about a specific element within that schema,
and it cares nothing for the rest of the schema. If you tell the
application more than it wants to know, if will get mad and probably eat
you.

How do I smartly (in the context of performance) pull the definition of an
element from the 'master schema' and create a 'mini-schema' that only
defines the target element such that I can allow an end user of the
application to create (via dynamic forms) XML data that I can then validate
against the 'mini-schema' ?
--longer version--
Basically, I am given a very large and rather complex schema from an
external (immutable) system. With only the schema, I am to create an
application (ASP.NET via C#) that generates a TreeView which represents the
elements within the schema. When an element gets clicked in the TreeView, a
dynamic form is generated such that the user is prompted to enter the data
required to create the element they initially clicked on. This allows a
user to intuitively create XML data - piecemeal - against a very complex
schema that I can then send back to that external system.

The problem is that I want to be able to validate each element as the user
submits it as opposed to validating the totality of their entry against the
entire schema. To do this, I need to know the schema definition for the
element that the user is entering data for so that I can validate their
piecmeal entry on the spot.

How, therefore, can I get a 'mimi schema' for an element within a much
larger schema?

Thanks and stuff!
John Ruiz
-------------------------------------------------------
I am John's witty signature. Only fools don't laugh at it.
Nov 11 '05 #1
1 1643
John Ruiz wrote:
i have an .xsd file (XML Schema). It has many elements in it (tags).

Sometimes, my application wants to know everything there is to know
(attributes, constraints, etc) about a specific element within that schema,
and it cares nothing for the rest of the schema. If you tell the
application more than it wants to know, if will get mad and probably eat
you.

How do I smartly (in the context of performance) pull the definition of an
element from the 'master schema' and create a 'mini-schema' that only
defines the target element such that I can allow an end user of the
application to create (via dynamic forms) XML data that I can then validate
against the 'mini-schema' ?


Well, using System.Xml.Sche ma namespace you should be able to load and compile
big schema, then pull definition of some element form it and build mini-schema
for it on the fly. But I share you concerns about performance, that isn't
going to be fast validation, but I believe you should try it first and measure.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2

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

Similar topics

4
2054
by: Robert Ludewig | last post by:
This is my XML Schema (Sitemap.xsd) : <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.htw-dresden.de/SitemapNS"> <xs:element name="Sitemap"> <xs:complexType> <xs:all> <xs:element name="Page"> <xs:complexType>
2
9094
by: AlexS | last post by:
Hello, I have error when reading schema using XmlSchema. Read and then .Compile: System.Xml.Schema.XmlSchemaException: May not be nominated as the {substitution group affiliation} of any other declaration. An error occurred at , (11, 3). Schema compile error: System.Exception: Schema error ---> System.Xml.Schema.XmlSchemaException: May no
3
2806
by: Nathan Wallace | last post by:
Hello, I have 2 schema, for argument sake let's call them child.xsd and parent.xsd. I define all my types in parent.xsd and the child.xsd include the parent.xsd using the following tag: <xs:include schemaLocation="http://localhost/xsds/parent.xsd"/> Now when I create an XmlSchema object on the child.xsd I couldn't get the type that I define in the parent.xsd. How do I get this? Do I need to create
1
1879
by: Victor Hadianto | last post by:
Hi, I have a simple XSD for example like this: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="qualified"> <xs:element name="customer"> <xs:complexType mixed="false"> <xs:sequence>
0
1353
by: John | last post by:
Hi, I'm creating a component to generate a schema file much like VS generates for DataSets. I'm using XmlSchema to do the job and I also am using a XmlNamespaceManager to manage namespaces. XmlNamespaceManager nsmgr = new XmlNamespaceManager(nt); nsmgr.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema"); nsmgr.AddNamespace("msdata", "urn:schemas-microsoft-com:xml-msdata"); nsmgr.AddNamespace("mstns",...
1
1390
by: SideByEach | last post by:
If I wanted to find the type referenced in this XML's root node, what object would I use in the SOM? <xs:schema xmlns="http://www.w3.org/1999/XSL/Transform"elementFormDefault="qualified" targetNamespace="http://www.w3.org/1999/XSL/Transform"xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vs="http://schemas.microsoft.com/Visual-Studio-Intellisense">
1
1164
by: ree32 | last post by:
When I try and load an xmldocument with its schema into an dataset. It always returns 0 tables. ds.ReadXml(Server.MapPath("\" & "data\ohsReport.xml", XmlReadMode.ReadSchema) Does anyone know what is causing this problem? ----------- OhsReport.xml -------------- <?xml version="1.0" standalone="yes"?>
4
1655
by: Igor Koretsky | last post by:
Hi. Using VB.Net System.Xml 1.0 SchemaCollection Object I am getting an error when trying to add ‘Schema A’ to the SchemaCollection. Here are my schema files..
1
4030
by: Ryan | last post by:
Hello Xml Gurus, I'm trying to build an XML schema in memory using the System.Xml.XmlSchema namespace objects, validate it, and then write it to a file. The problem I'm facing is that XmlSchema.Write() is changing <xsd:element minOccurs="1" name="AccountId" type="s-xsd:primarykey" /> to be
0
2039
by: =?Utf-8?B?TGFzdGJ1aWxkZXJz?= | last post by:
Hi all, I have a weird problem which has been causing me a headache for the last two days. I have to dynamicly generate a schema in memory and load it into a dataset in memory to be returned for further use. To create the schema I am using the XMLSchema classes and the result is the
0
9704
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9572
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9132
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7608
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5508
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2978
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.