|
|
Is it possible to restrict the enumeration of an attribute in dependecy of another attribute of the element?
For example <car manufacturer="x" model="y"> where the model enumeration is dependent of the manufacturer?
|
|
|
|
|
I have an XML file that contains lot of records.
For performance reasons, i wanted to read the file using filestream and streamreader. Also, it should read from the last. I need to retrive latest records.
How to move to previous line??
Thanks in advance
Praveen Raghuvanshi
Software Engineer
|
|
|
|
|
Can you count how many lines that you had read by using an integer count?
i love IT
|
|
|
|
|
I am creating an XML string using serialization and it is formed in UTF-16. I want to make it to UTF-8 . What are the possibilities and how can I do it.
Since this is a very urgent issue I don't have time to do R&D. I would appreciate if somebody could give a quick solution.
|
|
|
|
|
WideCharToMultiByte() will do that.
|
|
|
|
|
Is it possible to use the values from a XML file as the restriction/enumeration in a schema?
The only way I know off is to use XSL to generate a XSD file that only contains the enumeration and then include it into the other XSD file.
For example a customers.xml and a order.xsd as the schmema for orders.xml, where the name should be restricted to those in customers.xml.
|
|
|
|
|
Andre Buenger wrote: The only way I know off is to use XSL to generate a XSD file that only contains the enumeration and then include it into the other XSD file.
Not the only way (e.g. you could put the enumeration into orders.xsd and use DOM to change it according to the content of customers.xml), but I think your approach is better and far more practible, so in my opinion you should go for it.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Ok, this should be simple, but it doesn't seem to be.
XmlDocument object in memory that contains something like:
<content>testing ' and " and ' and "</content>
After I build my document with appropriate nodes, and set the value of the content node (with entities), I need to extract the xml as a string.
So far, every method I've used to extract the xml as a string converts the enties, so ' becomes ' and " becomes ".
The vendor that I'm working with is expecting the entities, not the converted characters.
??
|
|
|
|
|
You will need some how to replace the & character with & amp; This way the XmlDocument object will confuse and will translate the & amp; as & only. You will then have & amp;apos; in the memory, which should become & apos; when you get it.
Hope it helps.
|
|
|
|
|
Hi
Struggling here to sort, using xpath, an xml file by absolute numerics. My data (unfortunately) comes in comma formatted :-
<line id="1" impact="100,000,000.00"><br />
<line id="2" impact="-110,000,000.56">
I need to display this in order of the absolute value. I have googled and found the following xpath expression, but it doesn't seem to work. Any ideas?
expr.AddSort("concat( substring('-', 2 - (@impact < 0)), '1' ) * @impact", ( System.Xml.XPath.XmlSortOrder.Ascending , System.Xml.XPath.XmlCaseOrder.None, "", System.Xml.XPath.XmlDataType.Number);
Cheers
|
|
|
|
|
Sorted! (pardon the pun)
<br />
class myComparer : IComparer<br />
{<br />
<br />
public int Compare(object x, object y)<br />
{<br />
double l1 = double.Parse(x as string);
double l2 = double.Parse(y as string);<br />
l1 = Math.Abs(l1);<br />
l2 = Math.Abs(l2);<br />
<br />
if (l1 < l2) return -1;<br />
<br />
if (l1 > l2) return 1;<br />
<br />
return 0;<br />
}<br />
}<br />
and then use the comparer in the xpath expression
<br />
expr.AddSort("@Value" , new myComparer())<br />
Happy to be told there is a better way...
Cheers
|
|
|
|
|
My exercise is using Eclipse to write a web application, and requirement is using XML to write database. Please show me how, thanks so much! : )
|
|
|
|
|
|
hihi i'm a newbe in Java. If u don't mind, please show me basic code to create an XML file (i understood XML structure), how to retrieve data from this file and write data to it. I need to develop my application in "Eclipse.exe".
Follow your instruction i read on "http://developerlife.com/xmljavatutorial1/default.htm" and see this coding:
import com.sun.xml.tree.*;<br />
import org.w3c.dom.*;
You must have the a String URL of the XML document before you can instantiate a DOM object from it. Assume that an XML file called AddressBook.xml is at the following URL:
http://beanfactory.com/xml/AddressBook.xml. Here is the code to create a DOM object from this URL:
try <br />
{ <br />
String url = "http://beanfactory.com/xml/AddressBook.xml"; <br />
Document doc = XmlDocumentBuilder.createXmlDocument(url);<br />
}<br />
catch(Exception e){}
But i can not download Sun's parser or IBM's parser.
Can u tell me another way : )
-- modified at 1:55 Tuesday 19th December, 2006
|
|
|
|
|
These parsers might be available to you:
http://xerces.apache.org/[^]
or
http://www.jclark.com/xml/[^]
Also, I am really a C++ programmer with a little Java programming knowledge. So, I cannot really give a good example using Eclipse.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
hihi me too. I use C as my main language, but my new project using Java and Japanese. So i must try so much Arigato
|
|
|
|
|
Hi,
Can anyone plz tell me how to use XMl SChema.Me a Beginner in Xml ..
the exact requirment is ....
I have to store the textbox values from ASP.NET in to a XML file using XML schema.
hope u guys vl help me to solve this..
Thanks in advance..
Regards
Bino Varghese
|
|
|
|
|
Simply spoken a XML Schema describes a set of elements and attributes and how these are allowed to be nested. Each XML file that claims to conform to the Schema has to follow these rules.
In your case the Schema has nothing to do with the storing process itself, but it gives you the possibility to validate whether your storage file (still) has the expected structure/content.
Out there are many tutorials on XML and XML Schema that can be easily found with google or the search engine of your choice. I suggest you read some of them, try to solve the problem on your own and come back if you get stuck at some point.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thank u Stefan 4 ur reply.
U have cleared my doubt.I take ur suggestions to start reading abt XML Schema.
Can u please suggest me some tips how to store values from a Texbox of ASP.NET page to XML .
me using SQL2005 to store values but the client wants it to be XML FILE.
so plz help me dude.
Thanking you
Bino Varghese
|
|
|
|
|
Well your best bet would be to use an instance of XmlDocument class that gives you a DOM representation of your XML file and add nodes to it according to the structure of your XML. Take a look at the MSDN documentation for the XmlDocument class which provides some examples and many links for further reading.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Thank you Stefan
|
|
|
|
|
how to read the content of the XML File when we dont know the nodes.
Mohinder Singh
|
|
|
|
|
If you're using DOM to access the XML file you can simply iterate over the child nodes of a given node starting with the document's root node.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi all,
i am new to .net technology (and also to XML). please can anyone explain me these:
1.When we are constructing an XML DTD, how can we create an external entity reference in an attribute value?
2.please can u Give some examples of XML DTDs or schemas that we generally have to work with?
3.which type of applications that can benefit from using XML?
Thanks,
Rahi
If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|