473,573 Members | 3,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RELAX NG text constraint


I'm trying to write a RELAX NG schema that *only* validates the
following XML instance (with mixed content):

<div id="1">A<a href="X"/></div>

The problem is to constrain the text value after the opening <div> tag
to some fixed value. Is this actually possible, and if so, how can it
be done?

I tried with the following schema, but validation fails at the
"<value>A</value>" line. Jing says: Error, group of "string" or "data"

<element name="div">
<attribute name="id">
<element name="a">
<attribute name="href"/>

Jul 20 '05 #1
0 1147

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

Similar topics

by: Jari Kujansuu | last post by:
I am trying to learn to use jing through JARV interface and I have read JARV User's Guide (http://iso-relax.sourceforge.net/JARV/JARV.html). I have downloaded jingjarv-examples.zip from JARV User's Guide page and latest jing version 20030619 from jing home page. I can run jing successfully from command line like this (which I guess proves...
by: James McComb | last post by:
Please, can someone tell me how I can express this constraint using Relax NG? I want these documents to be valid: <memo> <code>WithMessage</code> <message>WithMessage means there is a message.</message> </memo>
by: Pieter | last post by:
I've read a lot of posts on "why relax ng is so very good" and on "why w3c xml schema should be the only schema language". I'm, however, still not clear on why I should prefer one over the other. I've made a small list of some good and bad points of both. These points don't really go into the grammar aspects of these languages, but are more...
by: Henri Sivonen | last post by:
I have written a servlet wrapper and a custom entity resolver for Jing. My code needs to decide whether to instantiate a compact syntax schema reader or an XML syntax schema reader. I would very much like to do the Right Thing. Currently, my code does the following; 1. If the HTTP Content-Type of the schema is application/vnd.relax-ng.rnc,...
by: withtape | last post by:
Somebody please, please help me. I'm getting started using Relax NG to describe document schemas. After reading the grammar summarized by http://www.relaxng.org/spec-20011203.html (Section 5), I conclude that the following is a valid Relax NG schema: <grammar xmlns="http://relaxng.org/ns/structure/1.0"> <start> <attribute name="wtf"/>...
by: kutty | last post by:
Hi All, I am loading data to a child table from a text file. the text files also contains data not referenced by parent key. while loading the data if one row fails to satisfies the constraint everything is getting rollback.. plz suggest me something.. which will help me to discard the unsatisfied rows and continue with the rest..
by: Torsten Munkelt | last post by:
Hi, I want to validate an XML document applying a combination of RELAX NG and Schematron. I have not found an appropriate validator. Would you please send me links to such validators. I would like to easily access it from within Java and from console. Thank you very much for your answers in advance.
by: McSwell | last post by:
We have a small (~50 line) DTD and a slightly larger (~300 line) W3C schema that we need to convert to Relax NG. (And I have a larger W3C schema that I may some day convert.) I was hoping that there would be some tools to get us started, but the list at http://relaxng.org/#conversion is not too promising. The one tool that looks like it...
by: Bartc | last post by:
The stdin/stdout files of C seem to be always in Text mode. Is there any way of running a C program so that these (but especially stdout) are in Binary mode instead? (I'm in the process of wrapping a different language around C which doesn't want the concept of text and binary files. But if I output a string such as "ONE\nTWO\n", this...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
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...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
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...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
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
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...

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.