Sure. I was thinking about doing that myself.Quote:
Originally Posted by eyeRmonkey
Printable View
Sure. I was thinking about doing that myself.Quote:
Originally Posted by eyeRmonkey
How does this look for a CodeBank submission? Should I add real error trapping inside the module? I've never done a real CodeBank sumbission before. Any other suggestions?
I don't know why you are hard-coding the xsl file in the program. Why not just open it like I did. I also don't know why you went from MSXML4 to MSXML2.
I hard coded it so you can easily add it to any project without having to keep track of the module and the .xsl. I see that as saving time and effort. That way you can just drop in the module to any project that uses XML and you don't have to think about it.
I switched it MSXML2 just in the example project because more people are likely to have MSXML2 than MSXML4 (I just got MSXML4 a few days ago). You can use the module with any version of MSXML.
Does that explain it better? Other than those, are there any changes I should make?
Here is what I'd do. The changes I made were minor and you should feel free to accept or reject any of them. You should of course remove all the commented-out code.
Martin,
I found a situation. Your method of indentation works all fine and dandy when it is just elements and attributes. When there is text in element area, for some reason, it does not indent properly the first element.
I attached a file so you can see the result. Notice, if I take out the text, everything is fine.
I forgot to link this thread back to my CodeBank submission. Here is the module that I created after Martin's help in this thread:
http://www.vbforums.com/showthread.php?t=368314
Liquid Metal,
Try that version of the code and see if you get the same results.
Still does the same thing. It will indent all except for the first child node under the root if the root has text.
I don't know what to say. I feel inclined to blame the MSXML isntead of my/Marty's code because all the code does is apply an XSL transformation and specify that we want to indent. Maybe Marty would have some insight into this problem?
No, sorry, I don't.Quote:
Originally Posted by eyeRmonkey
Thank You Martin and Monkey! It is not a big deal but just thought it was a bit strange. I didn't think it was your/Martin's code but was just puzzle how it were transformed.
I'm just curious. Your code reads the XML and formats it properly then prints it into a textbox, but how can i get it to write back to the XML file properly formatted?
i aslo do need to indent the xml file created thr' msxml4.0 with vb code not for loos but for finding the location of error om xml validation against xsd.
i do get the eror correctly but its detection in my xml file is difficult as it takes the whole created document as one line document & hence throws the eror no in different columns but samle line , line 1
but techincally on broswwwers it appears orrect , node by node with proper indention
if i redo the xml documnent manually in any ediotr i get the proper location
how do i rectify it thr; code