|
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
|
|
|
|
|
If you are using .NET Framework 1.1, it is XmlTextReader. If you are using .NET Framework 2.0, it is XmlReader. Anyway, you query differently with XmlTextReader/XmlReader since it uses a pull technique. However, you can get the same results but you have to do more coding. http://www.codeproject.com/useritems/XmlTextReader.asp[^]
|
|
|
|
|
George L. Jackson wrote: Your query won't work.
It worked when I ran it. Is that what you mean?
led mike
|
|
|
|
|
Here is another
XPath is pretty nice eh?
I always run these before I post them.
led mike
|
|
|
|
|
:-> My bad! Your code didn't seem correct to me. I am sorry.
|
|
|
|
|
George L. Jackson wrote: Your code didn't seem correct to me.
No sweat. It never seems right to me that's why I always run it.
led mike
|
|
|
|
|
Thanks Mike and George. I will try it out and revert back.
With warm regards,
Vinu
|
|
|
|