f



XML schema validation of one xml block based on values from another xml block

Hi!

Is possible to do xml validation of one xml block based on values from
another xml block?

For example, I have an input xml file containing account types.
<Root>
<AccountTypes>
	<AccountType></AccountType>
	�������������..
</AccountTypes>

<Accounts>
	<Account>
          <AccountType></AccountType>
       </Account>
</Accounts>
</Root>

Is there a way I can put restriction in schema that <Account> must
have only such <AccountType> that are listed in <AccountTypes>


The file size is 20-25 MB. (It would not be a good idea to load it
into DOM)
It is preferably to catch it before processing will start

Thank you,
Andy
0
net__space (10)
11/18/2004 11:04:41 PM
comp.text.xml 8781 articles. 0 followers. Post Follow

0 Replies
1051 Views

Similar Articles

[PageSpeed] 14

Reply:

Similar Artilces:

XML or not XML?
I am developing a simple MySQL database editor, and am looking into creating an PHP/AJAX app as the GUI. A lot of this in new ground, and much more is dusting off things I haven't used in a while. My question though involves whether or nor to employ XML. I did some XML a few years back, but don't typically bother anymore. As I see it XML is great when I need to have an app with a standard data presentation that other developers can easily interface. I.E. like a bank statement that may feed a variety of applications developed by a variety of clients. However, if I am develo...

Help on including one XML document within another XML document using XML Schemas
Hi I would like to specify an XML schema that would allow an XML document to be included within another XML document. The following example schema gives an idea of what we're trying to achieve ServiceResponse.xsd -------------------- <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="serviceResponse" type="ServiceResponse"/> <xs:complexType name="ServiceResponse"> <xs:sequence> <xs:element name="anXMLDocument" type="xs:string"/> <xs:element name="someOtherData" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:schema> The element anXMLDocument would contain an XML data string that would be parsed against a different XML Schema. The identity of the XML Schema for parsing anXMLDocument is not known at the time the ServiceResponse XML is parsed. Previously when we used DTDs we used inline CDATA wrappers around the contained XML document to avoid it being parsed. Can we still continue to use inline CDATA wrappers around the XML data when we parse against XML schemas? I've tried looking into the XML Schema specs but the mention of CDATA seems a bit sparse and doesn't seem to answer the question. If we can't use an inline CDATA wrapper i...

To XML or not to XML?
Ok, it has been a while since I've needed to make an involved web page. Coming back on the scene now is a bit confusing, what with all the cool stuff to use like XML, PHP, MySQL, etc... So here is my question. I'm in search of a good dynamic way to generate web pages which separates content from presentation. I am seeking to create a web site that, to put it succinctly, has a list of users and sets of information corresponding to each user. I am familiar with how to do this using PHP, MySQL, and regular old HTML. I maintain the user database in MySQL and dynamically present it and the information with PHP. This is very easy to do in terms of coding for it. But I'm wondering? Is it time for me to switch to the XML with XSL method instead? Everyone seems to be talking of XML as the end all be all. I've looked into it, and on the surface, I just can't tell if it's worth it. I don't really see the benefit. XML is just a "create your own HTML tags" and then figure out wtf to do with them orgy. Great, so I can write <dog>Spot</dog>. Whoop de do, that's useless to me unless I write a parser for it to display it in a user friendly way. And I shouldn't have to write a parser, there should be standardized ones for certain purposes. But wait, isn't that what HTML already is? A bunch of <dog>Spot</dog> (figuratively speaking) with the parsers having been written and mostly standardized between companies ages ago...

XML to XML
I have a gnucash file that I'm trying to transform into an identical XML file without the invoices. I've been at this for a while now. The gnucash file is in XML and the element I'm looking into is: <gnc:transaction> I want to ignore those that contain <slot:key>gncInvoice</slot:key> which is a child of slot which is a child of slots which is a child of transactions. Any help you're willing to provide would be greatly appreciated. Thanks. Classic application for XSLT. Start with the identity transformation, then add a template which matches the ones you want to treat specially and yields no output. From your description that would be match="gnc:transaction[transactions/slots/slot/slot:key='gncInvoice']" with the namespaces declared appropriately in the stylesheet. (That looks like a somewhat unlikely markup design to me, but since I haven't played with gnucash at all I'm taking your word for it.) -- () ASCII Ribbon Campaign | Joe Kesselman /\ Stamp out HTML e-mail! | System architexture and kinetic poetry Actually, from the Relax-NG schema for gnucash, it looks like it should be more like "gnc:transaction[trn:slots/slot/slot:key='gncInvoice']" with gnc:, trn:, and slot: all bound to the appropriate namespace URIs. The fact that some of their elements -- eg <slot> -- aren't in any namespace is probably left over from a pre-namespaces initial design, as is their now-brok...

XML Validation From XML Schema
I am trying to validate a XML file from java according to a XML Schema and get a list of all elements that fail validation. I am utilizing a class that implements the ErrorHandler interface and can generate the list if all errors. The problem is that I need to send back the XPath of the offending elements. The data in the message field of the ErrorHandler is not the complete XPath. Does anyone have a solution of this problem? MJ ...

embedding xml in xml as non-xml :)
Hi all, I have an application that logs in xml. Assume <xmlLog></xmlLog>. In this element the app logs anything it gets from foreign hosts. Now if the host sends xml data, the structure of the document changes. ie. <xmlLog><somTag></somTag></xmlLog>. This will cause problems with my log reader, because it assumes that <xmlLog/> contains non-xml data. My question is, is there a way to treat the data in the <xmlLog/> element as non xml data. Something I can do that would treat anything this element contains as a literal? Any help or suggestions would be greatly appreciated. Regards, Mark Mark Van Orman <mark@icsaccess.com> wrote: > Hi all, > > I have an application that logs in xml. > > Assume <xmlLog></xmlLog>. In this element the app logs > anything it gets from foreign hosts. Now if the host sends xml > data, the structure of the document changes. ie. > <xmlLog><somTag></somTag></xmlLog>. This will cause problems > with my log reader, because it assumes that <xmlLog/> contains > non-xml data. > > My question is, is there a way to treat the data in the > <xmlLog/> element as non xml data. Something I can do that > would treat anything this element contains as a literal? > > Any help or suggestions would be greatly ap...

web.xml / XML schema issue, why do some XML schema attributes disappear
Hi I'm trying to get my j2ee app to run on Jboss (version 3.2.3), but Jboss complains there are some missing attributes in the web-app element. The attributes are present in the XML file, but they seem to be removed by the parser, also when I view the file in a web browser. My XML below (I have cut out a lot of stuff for the purpose of this post) <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app xmlns="...

Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file
Hello, i convert one XML-document by using XSLT into another XML-document. First change all attributes to elements is no problem. Then i try to insert a new element into the new document by XSLT, but it doesn't work correctly :-( Example: The XML-source-document: <?xml version="1.0" encoding="UTF-8"?> <data creationTime="2006-05-31" creationNumber="1"> <set number="0001" info="test"/> <set number="0002" info="test"/> </data> The following XML-destination-document has to become (watch the new element "sets"): <?xml version="1.0" encoding="UTF-8"?> <data> <creationTime>2006-05-31</creationTime> <creationNumber>1</creationNumber> <sets> <set> <number>0001</number> <info>test</info> </set> <set> <number>0002</number> <info>test</info> </set> </sets> </data> Here is my XSLT-stylesheet-attempt: <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes" /> <xsl:template match="@*"> <xsl:element name="{name()}"> <xsl:value-of select="."/> </xsl:element> <xsl:if test="n...

Validate xml via xml schema
hi, I have a LabVIEW VI where i read some elements from a .xml file. First i use the function Read_Characters_From_File and the output string is wired on property/method nodes of a MSXML Refnum. But on the point where i read from xml, the VI should check the associated xml schema (.xsd/.dtd). Is there any possibilty to get a pass oder fail if the xml document do/do not correspond to the DTD schema which belong to the xml file?LabVIEW version is 7.1Thanks for answer,shavo Hi shavo, i think you can use the activex webbrowser component to check the xml file. Hope it helps.Mike thanks for reply,...

Validate XML against DTD and/or XML Schema?
Hi folks, I have a need to validate XML files against both DTDs and XML Schema from the command line. In an ideal world, I'd be able to do something like: $ python validate.py foo.xml which would then parse and validate foo.xml using the schema or DTD referenced within it. What I'm looking for is the contents of validate.py. A Python solution isn't essential, but I like Python and I'm doing some other light XML stuff in Python, so I'd prefer it. I did some Googling, but I'm a little overwhelmed by the quantity and variety of stuff I found, and I found a lot of s...

XML Schema to validate against XML encryption
Hello, I'm trying to write a XML Schema to validate against a XML file which holds an element which contains either a plaint text password or a XML encryption element. A plain text example is: <Password>mySecret</Password> or a XML encrypted element: <Password> <EncryptedData xmlns="http://www.w3.org/2001/04/xmlenc#" Type="http://www.w3.org/2001/04/xmlenc#Content"> <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/> <CipherData> <CipherValue>Jha8fYGDje49Tkz0=</CipherValue> </CipherData> </EncryptedData> </Password> I tried to validate against it with following XML Schema: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" elementFormDefault="qualified"> <xsd:import namespace="http://www.w3.org/2001/04/xmlenc#" schemaLocation="http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/xenc-schema.xsd"/> <xsd:element name="Secret"> <xsd:complexType> <xsd:sequence> <xsd:element name="EncryptedData" type="xenc:EncryptedDataType" minOccurs="0" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:element> But it fails wi...

XML Schema to XML Schema Conversion
Subject: XML Schema to XML Schema Conversion I have an XML Schema A which needs to mapped to another XML Schema B. Is there any handy tool which I could use to convert from Schema A to Schema B? Any related informaiton on this is appreciated. Thanks! XML Schema's represent the overall structure of your xml document. So if you want a different schema, you should create it. If you have commonality between the two schema's then you should think of putting that commonality in another schema and import that schema to your other schemas.. ie. if Schema A and Schema B have common features, create Schema C import Schema C into both Schema A and Schema B. about transforming one schema to another, there is the XSLT transformation which possibly could do this (since XSD is itself an XML document) but i havent that myself. Stylus Studio is something that you may want to use to play with this. "Hari Om" <hari_om@hotmail.com> wrote in message news:d1d5ebe4.0403021238.4175e63f@posting.google.com... > Subject: XML Schema to XML Schema Conversion > > I have an XML Schema A which needs to mapped to another XML Schema B. > Is there any handy tool which I could use to convert from Schema A to > Schema B? > > Any related informaiton on this is appreciated. > > Thanks! ...

Using One XSLT and multiple XML Problem (One is XML and another one is XBRL)
Hi ~ Plz Help me ~~ My problem is.. XBRL Sample file ------------------ a.xbrl <?xml version="1.0" encoding="utf-8"?> <group xmlns="http://www.xbrl.org/2001/instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:link="http://www.xbrl.org/2001/XLink/xbrllinkbase" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ISO4217="http://www.iso.org/4217" xmlns:aXinfo="http://www.love.com" xmlns:kkw="http://www.love.com/xbrl/taxonomy" xsi:schemaLocation="http://www.love.com/xbrl/taxonomy kkw.xsd"> <!-- PARAMETER INFO --> <aXinfo:PARAMETER-INFO> <aXinfo:param name="companyCD" value="50925"/> ..... </aXinfo:PARAMETER-INFO> <!-- ELEMENTS --> <kkw:CRP_NM nonNumericContext="nonNumC1">cyber</kkw:CRP_NM> <kkw:RSP_DPT nonNumericContext="nonNumC1">300</kkw:RSP_DPT> ..... </group> ----------------------- and xml sample ----------------------- a.xml <?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/xsl" href="xbrl.xsl"?> <DOCUMENT EID="1"> ..... </DOCUMENT EID="1"> ----------------------- XSLT transform a.xml. I used document() function. ====> <xsl:value-of select="document(a.xbrl')/group/kkw:CRP_NM" /> But it...

Validating parsed XML document against XML-schema
*PROBLEM: how to validate parsed XML document against (parsed) XML-schema. *IN: XML document as org.w3c.dom.Document, XML-schema as stream *OUT: information if document is valid against schema. If document is not valid DETAILED information about ALL errors (especially: node that caused problem). *Additional information: - validation is performed quite often, - XML-document object is changed quite often, - XML-Schema is fixed. - XML-document doesn't contain information about related XML-schema (attr xsi:noNamespaceSchemaLocation) - XML-Sche...

XIncludes in the XML Schema-based XML file -- How to?
Hello, I was trying to find anything on the topic in the archives but failed. This may seem a well-known issue but I am a newbie on XML stuff. I have created an XML Schema file (XSD) which defines the structure and relations in a data set. And based on this, I have created an XML file which is my data set. The data set file became too big to be easily edited, so I wanted to split it into smaller chunks and make a master data set, which is based on my XML Schema and also allows for XIncludes. How do I create smaller chunks? Should they be based on the XML schema? Or rather a generic XML files? How do I create the master XML file? How to insert XInclude and my XML Schema references in the prolog? Thanks in advance, Zbyszek ...

Non-XML tagged value text to XML
I would like to use XSLT to translate some tagged value text to XML elements like this: Input Doc: <data>x=1.234 y=ABC z="Hello World"</data> Output Doc: <x>1.234</value> <y>ABC</y> <z>&quot;Hello World&quot;</z> Is XSLT up to the task? What would it look like? Most of the XSLT string processing code I've seen looks very verbose - can't be too efficient. mikea_59 wrote: > I would like to use XSLT to translate some tagged value text to XML > elements like this: > > Input Doc: > > <data>x=1.234 y=ABC z="Hello World"</data> > > Output Doc: > > <x>1.234</value> > <y>ABC</y> > <z>&quot;Hello World&quot;</z> > > Is XSLT up to the task? What would it look like? Most of the XSLT > string processing code I've seen looks very verbose - can't be too > efficient. Using XSLT 2.0 you can do that with regular expression matching as follows: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:output method="xml" encoding="UTF-8" indent="yes" /> <xsl:template match="/"> <results> <xsl:apply-templates /> </results> </xsl:template> <xsl:template match="data"...

Validating XML against a DTD that is not supplied in the XML Schema
Hi, I'm talking the problem of trying to validate whether a rss xml feed is well formed - i.e corresponds to the DTD and xml schema definitions. Given that rss comes in a number of forms: * Sometimes a DTD is referenced * Sometimes a schema is referenced, with namespaces * Most of the time, no DTD or schemas or namespaces are defined. My application requires to know whether an rss feed supplied is valid as there is processing on the data that occurs later. My orignal tack was to parse the data into objects ( via RSSDigester ) and then apply business logic. However, given that functio...

q) XML Schema and valid XML documents
Wikipedia provides the following definition for valid XML document (http://en.wikipedia.org/wiki/XML): it contains a reference to a Document Type Definition (DTD), and that its elements and attributes are declared in that DTD and follow the grammatical rules for them that the DTD specifies. There is no reference to XML Schema in the above defintion. I am presuming that this is a dated definition for valid XML document and that an XML document that has an XML Schema associated with it is also a valid XML document. Kindly confirm. Thanks, Ramesh In article &l...

XML validating using XML Schema in C
Hay friends. I am making XML parser using linux C. I would like to know some of the functions about validating my XML file with XML Schema in C. If any one has idea about parsing and validating XML doc with XML Schema using libxml.a or libxml2.a library in linux. Please do reply me back asap. thanks in advance. Jigar ...

[XML] Is there an XML group?
Hi, I've typed an XML source which calls a CSS source, the result should be a page displayed in IE6, instead I see the XML source. That's pretty logical since there a no XHTML tags for IE6 to interpret. I'm looking for a discussion group like'comp.lang.xml' but I can't find one. Please help me. The first task is to see the Blue Jay. universalbitmapper wrote: > I'm looking for a discussion group like'comp.lang.xml' but I can't find > one. There's a comp.text.xml, which might be what you're looking for. Note that I don't read it,...

XML to XML Transformation
I was thrust into XML about 2 weeks ago and don't know much yet. From another department in the corp I am receiving an XML file which concatenates nodes all on one line i.e. <car><make>ford</make><color>red</color><year>2001</year></car><car><make><mb> etc. etc. etc. Some lines are over 300 characters long. I need to translate this spagetti XML into something which is humanly readable. I probably need to use XSL however I'm not sure what I need to do. Any help will be much appreciated. "Will" <william.cook@kla-tencor.com> wrote in message news:8506d1f6.0310311244.49a0856c@posting.google.com... > I was thrust into XML about 2 weeks ago and don't know much yet. From > another department in the corp I am receiving an XML file which > concatenates nodes all on one line i.e. > <car><make>ford</make><color>red</color><year>2001</year></car><car><make><m b> > etc. etc. etc. Some lines are over 300 characters long. I need to > translate this spagetti XML into something which is humanly readable. View the xml file using IE or Mozilla -- they provide an appealing, aesthetic looking layout with collapse/expanding of contents of elements. > I probably need to use XSL however I'm not sure what I need to do. If you decide to use XSLT (if, because the first approach above is really what one needs...

Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser)
Hello Usenet. I'm subject to some confusion with XML and UTF8. I'm working with XML-Simple and I try to decode some XML with with german umlauts (ISO-8859-1). The first XML line declared the encoding correct (see code below). But I'm getting different results using XML-Simple with the default XML parser named XML::Sax and a second parser named XML::Parser. The following code tries to decode the mini XML file and prints the UTF8 flags of the resulting strings. Can someone run this code on his machine and post the results? Thanks. The results on my machine are this: ���ä...

XML to XML conversion
Hello, I vageuly remember a standard that allowed for an XML document using one tag vocabulary to be translated to a diffirent XML document using a diffirent tag vocabulary using the information provided in a kind of dictionary XML pointed to in an URL present in the original XML file. I am very interested in trying it out for various applications, but I can't find anything on the internet about it, since I don't remember it's name, only the general appearance. Can anyone help me with this? What I remember, approximately: The idea is that you have one XML file, in which the namespace is defined in the standard way, using an URI. The URI, however, is pointing to an online XML file. For example: <x xmlns:abc="http://www.server.org/dictionary.xml"> <abc:one>orange</abc:one> </x> This dictionary.xml then contains, for example: <root> <one> <format1>1</format1> <format2>uno</format2> <format3>ena</format3> <format4>ein</format4> </one> </root> So a program wishing to convert the original XML to, say format2, would end up with the following XML: <x> <uno>orange</uno> </x> What I remember is that this dictionary trick was mainly used to allow diffirent software to be able to interpret the same XML file, without all of the software needing to be programmed for the same tag vocabulary. The program w...

xml from 2 xml
Hi to everybody, would I like to create a consequential xml from the elaboration of two files xml using xslt, but is it possible to give in input to a trasform 2 files xml? thanks for the possible answers I have already found from me the answer: the function document('file2.xml') matatu ha scritto: > Hi to everybody, > > would I like to create a consequential xml from the elaboration of two > files xml using xslt, but is it possible to give in input to a trasform > 2 files xml? > > thanks for the possible answers ...

Web resources about - XML schema validation of one xml block based on values from another xml block - comp.text.xml

Cross-validation (statistics) - Wikipedia, the free encyclopedia
is a model validation technique for assessing how the results of a statistical analysis will generalize to an independent data set. It is mainly ...

Serena Williams eyes history, Caroline Wozniacki craves validation in women's US Open final
As Serena Williams eyes another slice of tennis history, Caroline Wozniacki is craving validation with a watershed US Open final triumph on Sunday ...

Travers Duncan asks High Court to strike down ICAC validation laws
ICAC could be sent back to the High Court as a challenge to new laws validating corruption findings looms.

Adam Scott proclaims Texas win as validation of No.1 ranking
... No.1 golfer, beating American Jason Dufner in the third hole of a play-off at the Colonial event. "It's a good feeling and maybe some validation ...

Hollande to sign gay marriage bill after Constitutional Council's validation
Hollande to sign gay marriage bill after Constitutional Council's validation People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, ...

Marketers, Get Ready for the 'Validation Era'
The public brands included has been engaging in a "friends" arms race. But there are signs that we know we overdid it.

Validation and Uncertainty
What an extraordinary conversation I had recently on Twitter. It started with Neil Killick’s statement that we should not consider our stories ...

Nvidia Icera 410 LTE Modem Passes AT&T Network Validation
... Today's news is a small step and logical precursor toward both goals, Nvidia's Icera 410 LTE and HSPA+ baseband has passed AT&T's network validation ...

Ting’s Q1 Subscriber Growth Suffers from Sprint’s New Unlocking Validation Process
Back in February, Sprint updated the process it uses to validate unlocked devices that customers want to utilize on other carriers or one of ...

[Android M Feature Spotlight] Stricter APK Validation Now Actually Checks If All Of An APK's Files Are ...
While you might file this one under "really? We weren't doing this already?" if you're a security expert, Google has added stricter validation ...

Resources last updated: 3/14/2016 12:16:46 AM