|
I'm sorry to hear it does not work properly. Since I have no pratical experience with customizing the writing of XMl files (output generated by XmlDocument.Save was always sufficient for my needs), I cannot really help you here. The best thing I can suggest is playing around with the properties of the XmlWriterSettings class regarding new lines (obviously you already done this), check whether this only happens if you use the ASCIIEncoding class or also with other encodings and maybe use the same XmlWriterSettings for reading too.
"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
|
|
|
|
|
I finally worked it out... the XmlWriterSettings.Indent setting not only indents, but also adds the line breaks.
|
|
|
|
|
Duncan Sample wrote: I finally worked it out...
Congratulation
"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..
I need to create aspx page dynamically using xml and xslt? Could anyone please help me in creating an Aspx page using xml and xslt.
Thanks & Regards,
Venkat
|
|
|
|
|
What is it exactly that you need help with?
"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
|
|
|
|
|
I need to create new aspx page with the help of xml and xslt? The aspx page has to be created hrough xml and xslt
Thanks & Regards,
Venkat
|
|
|
|
|
You already said that. Simply repeating your question does not bring you any closer to getting a useful answer.
So I rephrase the question a bit. What should be contained in the XML file and what should the transformation with XSLT do? Did you already read something about XSLT? If not the following site would be a good starting point http://www.w3schools.com/xsl/.
"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
|
|
|
|
|
What are you trying to create from xml file? Final HTML markup, or "aspx page" with user controls like <asp:TextBox> etc?
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
I want to have an array of finite numbers/strings in the xml and validate it using the XSD file, can this be done
i know i could concatenate the array pass as comma seperated string or something but is there a better more standard way
thanks for your help
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
I'd suggest using a structure like this:
<complexType name="numbersArray">
<sequence>
<element name="item" type="xsd:int" minOccurs="0" maxOccurs="unbounded" />
</sequence>
</complexType>
A conforming XML file would look like this:
<numbersArray>
<item>1</item>
<item>5</item>
</numbersArray>
"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 Cookwww.troschuetz.de
|
|
|
|
|
Excellent
Haven't tried it yet but thanks
Is there anyway to tweak this to use enums as well
[edit]forgot to vote 5! [/edit]
|
|
|
|
|
Monty2 wrote: Is there anyway to tweak this to use enums as well
Do you mean like that?
<simpleType name="color">
<restriction base="xsd:string">
<enumeration value="red" />
<enumeration value="green" />
</restriction>
</simpleType>
<complexType name="colorArray">
<sequence>
<element name="item" type="color" minOccurs="0" maxOccurs="unbounded" />
</sequence>
</complexType>
"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 Cookwww.troschuetz.de
|
|
|
|
|
Can you please write the corresponding XML as well thankyou so much for your precious time
[edit]sorry got it[/edit]
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
I need to create XML document from schema without using any tool (dynamically)
|
|
|
|
|
I want to create an light weight XML database, but I don't find anything which could interest me.
It is to make a very small DB, in XML format (so it could be modified with any text editor). I want to completely integrates database API in my executable (I don't want to use software like MySQL or PostgreSQL, because it must be on any computer with no installation required). So my executable must integrates database API and store data into XML file format.
I've an idea about using SQLite and any XML parser like Pugxml but I would like to find something like SQLite with storing data directly in XML.
does anyone knows something about doing this ?
I work on Visual C++ 6.0 Sp6 (MFC/ATL).
thanks for all
Le Sourcier
My Foo website
|
|
|
|
|
How the XML declaration differs for Valid and Well Formed XMLs. And how can we select give the values for "Version" and "Encoding" attributes in an XML file. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
indian143 wrote: How the XML declaration differs for Valid and Well Formed XMLs.
It does not differ.
indian143 wrote: And how can we select give the values for "Version" and "Encoding" attributes in an XML file.
What exactly does that mean? Do you want to retrieve the concrete values values of a specific XML file?
"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
|
|
|
|
|
What is xsd and xslt. Whats the difference between these two. What will be the first line in every valid and well-formed xml files.
How these xsd and xsld are usefull to define a valid and well formed xml file. Thank you in advance.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
indian143 wrote: What is xsd and xslt. Whats the difference between these two.
http://www.w3schools.com/[^]
indian143 wrote: What will be the first line in every valid and well-formed xml files.
The XML declaration
indian143 wrote: How these xsd and xsld are usefull to define a valid and well formed xml file.
XSLT has nothing to do with validity of XML files.
"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,
Can anybody please tell me the difference between Well formed and Valid XML. Thank you.
And please give me a link for knowing about the XML and contents of Valid and Well formed XML's and how to create them. Thank you.
Regards,
S/W Engineer
Akebono Soft Technologies
aleem_abdul@akebonosoft.com.
|
|
|
|
|
Well, "well-formed" XML is syntactically valid XML. "Valid" XML is always well-formed, but must also be semantically correct. XML is not valid when you use unknown elements, attributes or invalid child elements etc.
example:
Let's say you have XML document describing car. You have some schema (.xsd file), allowing only wheel element inside car element.
<car>
<wheel />
<wheel />
<sometotalydifferentxmlelement />
</car>
is well-formed XML, but invalid.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
<students>
<id="501",name="ravi">
<id="502",name="kiran">
<students>
i need to bind xml to 2 dropdownbox in .net and once i clik on id i need to get the corresponding value in 2 dropdownbox
plz let me know
|
|
|
|
|
No one can understand your question please can you elaborate it ?
|
|
|
|
|
Can this code snippet be optimized?
dim xwriter as xmltextwriter
dim fo as folder
dim file as Scripting.File
......
xwriter = New XmlTextWriter(filename, System.Text.Encoding.UTF8)
Try
fo = fso.GetFolder(spath)
Catch ex As Exception
MessageBox.Show( ex.Message )
Exit Sub
End Try
xwriter.WriteStartDocument()
xwriter.Formatting() = Formatting.Indented
xwriter.WriteStartElement("directory")
xwriter.WriteAttributeString("Name", fo.Name)
xwriter.WriteAttributeString("marked", "0")
xwriter.WriteAttributeString("Path", fo.Path)
For Each file In fo.Files
xwriter.WriteStartElement("file")
xwriter.WriteAttributeString("Name", file.Name)
xwriter.WriteAttributeString("marked", "0")
xwriter.WriteAttributeString("Path", file.Path)
xwriter.WriteEndElement() 'Ende file
Next
'xml-file is filled recursive
xmlschreiben(xwriter, fo)
xwriter.WriteEndElement()
xwriter.WriteEndDocument()
xwriter.Close()
......
Public Sub xmlschreiben(ByRef xwriter As XmlTextWriter, ByRef folder As Folder)
Dim subfo As Folder
Dim file As Scripting.File
Try
For Each subfo In folder.SubFolders
'directories:
xwriter.WriteStartElement("directory")
xwriter.WriteAttributeString("Name", subfo.Name)
xwriter.WriteAttributeString("marked", "0")
xwriter.WriteAttributeString("Path", subfo.Path)
'files
For Each file In subfo.Files
xwriter.WriteStartElement("file")
xwriter.WriteAttributeString("Name", file.Name)
xwriter.WriteAttributeString("marked", "0")
xwriter.WriteAttributeString("Path", file.Path)
xwriter.WriteEndElement() 'Ende file
Next
If subfo.SubFolders.Count <> 0 Then
xmlschreiben(xwriter, subfo)
End If
xwriter.WriteEndElement() 'Ende directory
Next
Catch ex As IOException
MessageBox.Show(ex.Message)
End Try
End Sub
Does anybody of you have an idea how to optimize this code? i don't but I need to make the performance of this code snippet faster than before! Thank you very much for your help!
|
|
|
|
|
I do not have much experience with VB.NET, but I think it would be sufficient to declare the arguments of the xmlSchreiben method as ByVal , because you only use the parameters but never assign new values to them. Furthermore, it should be sufficient to the following check: If subfo.SubFolders.Count > 0 Then .
"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
|
|
|
|