|
I need to define 2 rules in my schema .
The validated xml is of the form
<root>
<vegetable>
<class>root</radish>
<type>A</type>
<value>moderate</value>
</vegetable>
<vegetable>
...
...
</vegetable>
..
..
</root>
Condition 1: When class is 'seed' - element 'type' is optional else mandatory.
Condition 2: Atleast one 'vegetable' should have 'value' as 'benficial'.
How do i define these conditions in the schema?
|
|
|
|
|
|
I have a structure like this
<book>
...
<content>
......
</content>
...
</book>
I would like to use all HTML elements in <content> without declaring them again!
How to do that?
|
|
|
|
|
I am not sure of what you want here?
If you do the following:
<html xmlns="http://www.w3.org./1999/xhtml">,
you are getting the schema of xhtml but you won't have the physical xhtml elements created for you.
|
|
|
|
|
I am basically using .net web services for application to application communication on the web. Now I need to transfer simple xml files from a web application to another.My ultimate target is to update the xml files into a SQL Server database at the other end.What would be the best way to transfer the xml file?
I am envisioning to read the xml file into a dataset and then send the dataset as parameter to a web service call.The dataset will finally be loaded into database by remote web application.
Will this solution give me the best performance.Or I need to transmit the xml file as it is and then read the xml file into dataset before updating into the database?
Suggestion/Comments or alternative ideas are sought.
Thanks for your time and consideration.
Rabindra
|
|
|
|
|
rabing wrote: Will this solution give me the best performance
No. Opening a database connection and inserting the data using a "bulk insert" type operation would give the best performance.
led mike
|
|
|
|
|
Thanks for your reply,,,, I will give it a 'thought'.
Rabidnra
|
|
|
|
|
I use a schema to create a structure like this
<book>
...
<content>
<p>....</p>
</content>
</book>
<p> tag is the paragraph like normal, but when I try to create another tag, <big> for example, then I put it in schema in this order
<book>
...
<content>
<big>...</big>
<p>....</p>
</content>
</book>
I would like to use big like the tag <b> in HTML, but when I try to put <big> tag after <p> tag, it is said that "element p expected" (I use XMLSpy to edit my files). How can I make <big> used any where (no matter where <big> is after or before <p>)?
The second question is: how can I make a child tag, <italic> for example, inside <p>, that can be use any where inside <p>?
|
|
|
|
|
The schemas for all versions of HTML (I may be wrong here) are written in DTD. Doing what you can be expressed using a DTD. However, XML schemas cannot do everything a DTD can (and the reverse is true!)
Go to http://www.w3.org/[^] for more information.
Unfortunately, I don't have an answer for you but I think what you want cannot not be 100% implemented in a XML schema.
|
|
|
|
|
|
I have never before used xml, so please go easy on me. I am creating a game for which the rules, will be stored in an xml file. These rules will vary from city to city, so it's important I can easily and quickly add support for a new variation. My xml file looks something like this
<?xml version="1.0" encoding="utf-8" ?>
<!-- Root Node -->
<WinningHands>
<!-- List of regions -->
<Region Country="" Province="" City="">
<!-- List of winning hand types -->
<Hand>
<!-- Single hand attributes -->
<Name></Name>
<Score></Score>
</Hand>
</Region>
</WinningHands>
In the final product there would be a list of maybe 10 to 15 Hand elements, and a few hundred Region elements. With my current design, the file size is going to bloated with repeated Hand elements. If I do it the other way around, creating Region as a child of Hand, there would be a large list of Regions to parse.
Overall, either way is going to be slow to parse and load. So I'm asking for some suggestions as to the best way to accomplish the task.
|
|
|
|
|
You can flatten your XML by using more attributes:
<?xml version="1.0" encoding="utf-8"?>
<!-- Root Node -->
<WinningHands>
<!-- List of regions -->
<Region Country="" Province="" City="">
<!-- List of winning hand types -->
<Hand Name="" Score="" />
<Hand Name="" Score="" />
<Hand Name="" Score="" />
</Region>
</WinningHands>
|
|
|
|
|
In my project it is require to open two webpages.If firstpage is not avaialble then open secondpage.can any body help me in my project.
#sanroop#
|
|
|
|
|
I am using a WebService that returns a string. The string is actually a small xml file. I want to display the different elements, but am wondering what the best way to parse them is. Should I use an XmlDocument and read the innertext of each node? Is there a way to get all nodes without declaring each one individually?
Thanks
Eric
|
|
|
|
|
Hi
How can i include a formatted text field inside an xml document? ie:
< Paragraph>
<Color>Red</Color>
<Font>WingDings</Font>
<Text> this is the text & it needs to be able to hold all characters.
Formatting Info needs to
Be maintaind. So do things like this:
$1.56 < $2.25 & so on...
<Text
</Paragraph>
I've been mudling around with XmlSerializer but XmlSerializer.Deserialize dies on & and < ect. and looses formating.
-- modified at 17:13 Friday 22nd September, 2006
Ronald Hahn, CNT - Computer Engineering Technologist
New Technologies Analyst
HahnTech Affiliated With Code Constructors
Edmonton, Alberta, Canada
Email: rhahn82@telus.net
|
|
|
|
|
You can:
1) Use a CData Section although even then there is the ending "]]" sequence that the data must not contain.
2) Encode the data like in Base64.
led mike
|
|
|
|
|
Hi,
I am trying to use the IF statement logic inside xml.
So came up with the line below:
The logic that I am trying to achieve is:
if there is a value for the field COMX_Field1 (i.e. if COMX_Field1 = TRUE) then show COMX_Field2, else do not show anything.
Is this correct?
Thanks
<line id="02">
<value x="1.00" formula="true">
|
|
|
|
|
=("{COMX_Field1}"="1")?"COMX_field2":""<br />
what is that supposed to be?
fmardani wrote: I am trying to use the IF statement logic inside xml.
I have no idea what that means.
led mike
|
|
|
|
|
When you say you are using the "IF statement logic inside xml", do you mean you are programming with XSLT?
|
|
|
|
|
Forum written in php is very popular. But anybody has idea about managing a forum content by xml?
|
|
|
|
|
I have an XML document in my asp.net application containing country information
eg
<Country>
<CNo>1</CNo>
<Country>Afghanistan</Country>
<Nationality>Afghan</Nationality>
<ISDCode>93</ISDCode>
<Continent>Asia</Continent>
</Country>
<Country>
<CNo>2</CNo>
<Country>Albania</Country>
<Nationality>Albanian</Nationality>
<ISDCode>355</ISDCode>
<Continent>Europe</Continent>
</Country>
<Country>
<CNo>3</CNo>
<Country>Algeria</Country>
<Nationality>Algerian</Nationality>
<ISDCode>213</ISDCode>
<Continent>Africa</Continent>
</Country>
When a country is selected from a dropdown list, I want to be able to run through the xml document and pick out the corresponding continent only. What is the best way to do this?
Thanks, Vinu<
|
|
|
|
|
XPath
replace the '?' charcter with the number for the selected country
led mike
|
|
|
|
|
Mike,
Your query won't work. Since you know the country you can find the 'Country' child node of the parent (which happens to be 'Country' too), and, then, you can access its sibling 'Continent' node:
//Country[Country='Afghanistan']/Continent
|
|
|
|
|
Thanks Mike,
Will try out the solution you have suggested. Is there anyway I can do this using XMLTextReader...
Regards,
Vinu
|
|
|
|
|
vinusk wrote: can do this using XMLTextReader...
I have not used XMLTextReader much so I do not know, but typically if you are going to query XML you use a DOM and SelectNodes(). I would normally use XmlDocument for that.
led mike
|
|
|
|