|
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
|
|
|
|
|
Thanks got it working.
|
|
|
|
|
Hi folks,
I bind textboxes to nodes of an XmlDocument and refer to these nodes via an xpath statement. Updating existing content is really easy this way.
My problems arise, when I try my xpath statement does not find the node in question and subsequentially I want to create it.
Say, my xpath is "/def:Version/def:Entry[lang('en')]/Title" and the second element <entry xml:lang="en"> does not exist. At first I thought, I'd split my path into pieces, ininerate it backwards, reach the first existing node and then recreate the requested structure. This could work with very easy queries, but something like "def:Entry[lang('en')]" already would require my program to "understand" that it needs to create a <entry xml:lang="en"> from the xPath lang() function.
I would end up writing a strange kind of xpath parser. And the idea isn't so good either, because I'd have to make my xpath super verbose, so that no elements (attributes!) are left out (and therefore could be created at need), which doubtlessly would decrease performance.
I stumbled across a xupdate implementation at
http://www.openvue.net/projects.php?menu=4
It's nunit testcases don't work 100% so I would have to invest some more time into this.
That's why I wanted to ask you guys, what do you think: Xupdate is the way to go for me, or do you have any other good ideas?
Thanks in advance,
Jan
|
|
|
|
|
I am confused on what you are attempting to do. I use a key to find nodes that need updating. If a key is not present, I find nodes via its parents or search for nodes that are missing certain child nodes or attributes. You may need to just determine if the structure of your XML document is right for what you are trying to do.
|
|
|
|
|
Imagine the following xml:
<foo>
<bar action="1"><element>xxx<element></bar>
<bar action="2"><element>yyy<element></bar>
<bar action="3"><element>zzz<element></bar>
</foo>
I query: /foo/bar[action='1']/element
I get "xxx" and I can update it. Good.
I query: /foo/bar[action='4']/element
Now, this node does not exist, so it should be created (and it's predecessor bar with the attribute action=4). foo exists, so nothing needs to be done for it.
Same aplies for /foo/bar[4]/element, just the attribute has to come from somewhere else (I can provide for this).
/foo/bar[5]/element should fail
This is not for a special xml file, but a generic solution, so it does not depend on any certain structure...
Does this make things a bit clearer?
-- modified at 16:53 Thursday 21st September, 2006
|
|
|
|
|
I cannot see your XML. Use "Ignore HTML tags in this message ...".
|
|
|
|
|
this should be better, now
|
|
|
|