Click here to Skip to main content
15,889,096 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: Storing binary data in xml file msxml and sending it to client through winsock Pin
Samer Aburabie14-May-09 4:09
Samer Aburabie14-May-09 4:09 
QuestionI am not able to read xml node in XPathNodeIterator Pin
Naveed72710-May-09 22:32
Naveed72710-May-09 22:32 
QuestionOIM in MSN15 getting error: invalid parameter Pin
amit090210-May-09 21:33
amit090210-May-09 21:33 
QuestionValidating XML file Pin
Sumit Prakash Sharma6-May-09 19:38
professionalSumit Prakash Sharma6-May-09 19:38 
AnswerRe: Validating XML file Pin
led mike7-May-09 4:37
led mike7-May-09 4:37 
QuestionXML / CSL Macros Pin
SimonCropper6-May-09 17:27
SimonCropper6-May-09 17:27 
AnswerRe: XML / CSL Macros Pin
led mike7-May-09 4:35
led mike7-May-09 4:35 
Questionchange attributes whitin XML Pin
Member 37528166-May-09 4:50
Member 37528166-May-09 4:50 
Hello guys,

I am having a problem with the order or the attributes with xml in vb.

I get the following header:
<?xml version="1.0" ?> 
- <tvtnl:spotPlanningFile xsi:schemaLocation="http://www.tvtimes.nl/sko/schema/20010910" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tvtnl="http://www.tvtimes.nl/sko/schema/20010910">


and I need:
<?xml version="1.0" ?> 
- <tvtnl:spotPlanningFile xmlns:tvtnl="http://www.tvtimes.nl/sko/schema/20010910" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.tvtimes.nl/sko/schema/20010910">


notice the first and the last attribute.(they need to be switched)

my code to come to this:
Dim xmlDoc As New Xml.XmlDocument
Dim xmlDeclaration As Xml.XmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", "", "")

'root
Dim rootNode As Xml.XmlElement = xmlDoc.CreateElement("tvtnl", "spotPlanningFile", "http://www.tvtimes.nl/sko/schema/20010910")
xmlDoc.InsertBefore(xmlDeclaration, xmlDoc.DocumentElement)

Dim att As Xml.XmlAttribute = xmlDoc.CreateAttribute("xsi:schemaLocation", "http://www.tvtimes.nl/sko/schema/20010910")
att.Value = "http://www.tvtimes.nl/sko/schema/20010910"
rootNode.SetAttributeNode(att)

rootNode.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
                    
xmlDoc.AppendChild(rootNode)


what am i doing wrong?

got any tips??

here is something i already tried:
Dim xmlDeclaration As Xml.XmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", "", "")

'root
Dim rootNode As Xml.XmlElement = xmlDoc.CreateElement("tvtnl", "spotPlanningFile", "http://www.tvtimes.nl/sko/schema/20010910")
xmlDoc.InsertBefore(xmlDeclaration, xmlDoc.DocumentElement)


'Dim xmlmanager As New Xml.XmlNamespaceManager(xmlDoc.NameTable)
'xmlmanager.AddNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance")

Dim att As Xml.XmlAttribute = xmlDoc.CreateAttribute("xsi:schemaLocation", "http://www.tvtimes.nl/sko/schema/20010910")
att.Value = "http://www.tvtimes.nl/sko/schema/20010910"
rootNode.SetAttributeNode(att)


'XmlAttribute att = doc.CreateAttribute("xsi", "noNamespaceSchemaLocation", "http://www.w3.org/2001/XMLSchema-instance");
'att.Value = "TestCaseSchema_03.xsd";
'ele.SetAttributeNode(att);
'doc.AppendChild(ele);
xmlDoc.AppendChild(rootNode)


'rootNode.SetAttribute("xmlns:tvtnl", "http://www.tvtimes.nl/sko/schema/20010910")
rootNode.SetAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
'rootNode.SetAttribute("xsi:schemaLocation", "http://www.tvtimes.nl/sko/schema/20010910")
'rootNode.SetAttributeNode("localname", "namespace")
'Dim test As Xml.XmlAttribute = xmlDoc.CreateAttribute("pref", "localname", "namespace")
'rootNode.SetAttributeNode(test)
'xmlDoc.CreateAttribute("pref", "localname", "namespace")


any help is welcome.

best regards,
Roelant
QuestionFinding an assembly redirection in app.config Pin
mav.northwind5-May-09 0:40
mav.northwind5-May-09 0:40 
AnswerRe: Finding an assembly redirection in app.config Pin
mav.northwind5-May-09 1:37
mav.northwind5-May-09 1:37 
QuestionSAXModelBuilder vs DOM Parser Pin
Josh Owen4-May-09 9:57
Josh Owen4-May-09 9:57 
AnswerRe: SAXModelBuilder vs DOM Parser Pin
led mike4-May-09 11:09
led mike4-May-09 11:09 
GeneralRe: SAXModelBuilder vs DOM Parser Pin
Josh Owen4-May-09 11:17
Josh Owen4-May-09 11:17 
GeneralRe: SAXModelBuilder vs DOM Parser Pin
led mike5-May-09 4:51
led mike5-May-09 4:51 
GeneralRe: SAXModelBuilder vs DOM Parser Pin
Josh Owen5-May-09 4:57
Josh Owen5-May-09 4:57 
QuestionProblem in parsing xml to html Pin
Gokul.P29-Apr-09 21:02
Gokul.P29-Apr-09 21:02 
AnswerRe: Problem in parsing xml to html Pin
George L. Jackson30-Apr-09 1:56
George L. Jackson30-Apr-09 1:56 
QuestionDegree symbol ° in xml Pin
Gokul.P29-Apr-09 21:01
Gokul.P29-Apr-09 21:01 
AnswerRe: Degree symbol ° in xml Pin
George L. Jackson30-Apr-09 1:54
George L. Jackson30-Apr-09 1:54 
QuestionXml special character Pin
Soundman32.228-Apr-09 5:14
Soundman32.228-Apr-09 5:14 
AnswerRe: Xml special character Pin
Murugesan G29-Apr-09 0:53
Murugesan G29-Apr-09 0:53 
AnswerRe: Xml special character Pin
Member 37528166-May-09 20:08
Member 37528166-May-09 20:08 
QuestionGenerate-id Pin
LordLothar26-Apr-09 4:48
LordLothar26-Apr-09 4:48 
QuestionPhp parameter to xslt Pin
LordLothar25-Apr-09 4:15
LordLothar25-Apr-09 4:15 
QuestionImproving XML read/load performance Pin
Ekjon21-Apr-09 9:16
Ekjon21-Apr-09 9:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.