|
i am trying to read an mdb(ms access) file
that is i want to read data from an ms access sheet and i am unable to do it.
so please help me with some code relating to the access......
|
|
|
|
|
This has nothing to do with XML or XSL - please post in the appropriate forum.
|
|
|
|
|
hi,
I'm trying to write an XML document through XMLWriter Class. I'm retrieving records fromm a databse table and want to show them in a table format.
Can anyone tell me how to put tab spaces between two values? I'm using the WriteRaw method to write the records on the XML document
|
|
|
|
|
Hi..
I have a hidden text box value in my xslt page . Could anyone please help in retrieving the hidden text box value through xslt and assign the hidden textbox value to a variable?
Thanks & Regards,
Venkat
|
|
|
|
|
it is confusing to under stand... but i think first u have to attach that XSLT to any XML... and modify ur XSLT to store that value in sone variable...
|
|
|
|
|
Hi you experts.
If i call a specific url for example : https://webserver/APIpage.asp?
it returns an xml document that i want to edit in my desktop application.
Can you give me a snippet of code of how can i do that?
I have to make windows application that pick information of my clients, convert in xml and post to above URL as request and the webserver's APIpage.asp process my xml request then in retrun send me xml reponse back in few seconds
the reponse xml file will contain charges, transaction number and image that i have to update in my windows application back
Plz let me know how it can be done in vb.net 2005
Thank you all in advance.
|
|
|
|
|
Perhaps this is a rather basic question, but is there a way to get the path to an XSD file (considering it's added to my current project) without having to hard-code the path?
|
|
|
|
|
Application.StartupPath + Path.DirectorySeparatorChar + relative path to your file (in simplest case the filename)
"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
|
|
|
|
|
Great, thank you! I put the XSD file two directories up, so the following two lines now do the trick:
DirectoryInfo schemaDir = (Directory.GetParent(Application.StartupPath)).Parent).Parent;
string schemaFullName = schemaDir + Path.DirectorySeparatorChar + "OptionsSchema.xsd";
|
|
|
|
|
Please can someone help me with the following issue:
I am new to the development circle and my focus is C#. I have recently started to delve into the functionality of combining Web Service, SQL Databases and InfoPath Forms. Although I have successfully completed the Web Service and Database components, I have come unstuck with the InfoPath Forms which emphasize XML.
I have created two forms: PassingParameters.xsn (Contains a TextBox(txtInput) and a Button(btnSubmit))
ReceivedParameters.xsn (Contains just a TextBox (output) that is for displaying)
What I am trying to accomplish at first appeared very easy, but has become my nemesis! All that I want to do is pass the value I input in the TextBox on the 1st form to the TextBox on the 2nd form? Here is the code that I am trying to work with. It revolves around the NewFromSolutionWithData Method.
[InfoPathEventHandler(MatchPath = "btnSubmit", EventType = InfoPathEventType.OnClick)]
public void btnSubmit_OnClick(DocActionEvent e)
{
IXMLDOMProcessingInstruction oXML = thisXDocument.DOM.createProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\"");
IXMLDOMProcessingInstruction oPI = thisXDocument.DOM.createProcessingInstruction("mso-application", "progid=\"InfoPath.Document\"");
thisXDocument.DOM.insertBefore((IXMLDOMNode)oPI, thisXDocument.DOM.firstChild);
thisXDocument.DOM.insertBefore((IXMLDOMNode)oXML, thisXDocument.DOM.firstChild);
// Open a solution from a XML DOM
// Create a new DOM
IXMLDOMDocument newDoc = thisXDocument.CreateDOM();
string myXml = "<txtinput>";
newDoc.loadXML(myXml);
// Call NewSolutionWithData to open a new Form and load the XML
XDocument oXdpostingForm = thisApplication.XDocuments.NewFromSolution(@"C:\Program Files\bSOLVe_LS_Publish\PassingParameters.xsn");
XDocument oXdreceivingForm = thisApplication.XDocuments.NewFromSolutionWithData
("C:\\Program Files\\bSOLVe_LS_Publish\\Source_ParametersReceived\\template.xml",
@"C:\Program Files\bSOLVe_LS_Publish\ParametersReceived.xsn",
(int)XdDocumentVersionMode.xdFailOnVersionOlder);
I design the forms in a folder called bSOLVe_LS_Design giving them full trusted security. Once completed I publish the forms to another folder bSOLVe_LS_Publish, where I also install them. When I run the form I get the following exception:
InfoPath cannot create a new, blank form.
The system cannot find the path specified.
at Microsoft.Office.Interop.InfoPath.SemiTrust.XDocumentsCollectionWrapper.NewFromSolutionWithData
(Object varXMLData, Object varSolutionURI, Int32 dwBehavior)
|
|
|
|
|
Greetings,
I have an XmlSchemaAttribute. I want to determine if this XmlSchemaAttribute belongs to an attribute group (and if so, what group?). This is proving more difficult than I expected and I suspect I am going about it the wrong way.
Any help would be greatly appreciated.
Thanks!
Ian
|
|
|
|
|
hello,
i need to change the value of the attribute "marked " in an xmlelement.
I can gain access to the node which is practically this xmlelement by an XMLNodeReader.
But only xmlelement offers the function "setAttribute".
How can I manipulate this attribute?
thanks much for your help
this ist a code fragment:
dim xDoc as new XMLDocument
dim xreader as XMLNodeReader
dim xmlnode as XMLNode
xdoc.Load("Datei.xml")
xreader = New XmlNodeReader(xdoc.ChildNodes.Item(0))
While xreader.Read()
Select Case xreader.NodeType
Case XmlNodeType.Element
xmlelement = xdoc.ReadNode(xreader)
'the compiler won't warn me, but the attribute "marked" is not set afterwards
xmlelement.SetAttribute("marked", 0)
Exit While
Case Else
End Select
End While
this is my xml-file:
<directory marked="1">
</directory>
.....
|
|
|
|
|
I think the problem is that the ReadNode method creates a new XmlNode basing on the information of the XmlNode on which the XmlReader is currently positioned. Therefor, the "marked" attribute is set, but not in the original document. By the way, why don't you use the the GetElementsByTagName , SelectNodes or SelectSingleNode methods of the XmlDocument type?
"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
|
|
|
|
|
you are perfectly right. the attribute is only changed in the new Xmlelement.
Therefore i tried to replace the new element with the old element, but then it says that the object is not referred to an instance ( null reference exception), although I defined both xmlelements
While xreader.Read()
Select Case xreader.NodeType
Case XmlNodeType.Element
xmlelement1 = xdoc.ReadNode(xreader)
xmlelement2 = xmlelement1
xmlelement2.SetAttribute("marked", 0)
xdoc.ParentNode.ReplaceChild(xmlelement2, xmlelement1)'null reference exception
Exit While
Case Else
End Select
End While
i cannot use methods like selectsinglenode and getelementsbytagname, cause I only have two tags "directory" and "file". My xml-document shall represent a filesystem. I think this would be too complicated then.
<?xml version="1.0" encoding="utf-8"?>
<directory Name="AAverschiebtest" marked="0" Path="D:\AAverschiebtest">
<file Name="Form1.resx" marked="0" Path="D:\AAverschiebtest\Form1.resx" />
<file Name="Form1.vb" marked="0" Path="D:\AAverschiebtest\Form1.vb" />
<file Name="log.txt" marked="0" Path="D:\AAverschiebtest\log.txt" />
<file Name="ordnerjpg.JPG" marked="0" Path="D:\AAverschiebtest\ordnerjpg.JPG" />
<file Name="testspeicherplatzarchivierung3.sln" marked="0" Path="D:\AAverschiebtest\testspeicherplatzarchivierung3.sln" />
<file Name="testspeicherplatzarchivierung3.suo" marked="0" Path="D:\AAverschiebtest\testspeicherplatzarchivierung3.suo" />
<file Name="testspeicherplatzarchivierung3.vbproj" marked="0" Path="D:\AAverschiebtest\testspeicherplatzarchivierung3.vbproj" />
<file Name="testspeicherplatzarchivierung3.vbproj.user" marked="0" Path="D:\AAverschiebtest\testspeicherplatzarchivierung3.vbproj.user" />
<directory Name="bilder" marked="0" Path="D:\AAverschiebtest\bilder">
<file Name="asdfasdfasdf.xml" marked="0" Path="D:\AAverschiebtest\bilder\asdfasdfasdf.xml" />
<file Name="buch1111.xml" marked="0" Path="D:\AAverschiebtest\bilder\buch1111.xml" />
......
.....
thanks for your help
|
|
|
|
|
Leia2011 wrote: then it says that the object is not referred to an instance ( null reference exception), although I defined both xmlelements
It's not the elements that cause the NullReferenceException . It's the call of ReplaceChild on the XmlDocument.ParentNode property. A document has no parent node, so this property returns null and trying to call a method on it will result in a NullReferenceException . Try calling ReplaceChild directly on the XmlDocument or the return value of the DocumentElement property.
Leia2011 wrote: i cannot use methods like selectsinglenode and getelementsbytagname, cause I only have two tags "directory" and "file". My xml-document shall represent a filesystem. I think this would be too complicated then.
The question that arises is whether you want to set the "marked" attribute to "0" only on elements that are direct children of a specific "directory" element or on all elements.?
"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
|
|
|
|
|
thanks a lot for your help! it did indeed help me very much
I decided to convince me of xpath expressions finally
this is how I implemented it:
(this code sets the attribute of one marked element and all elements which are under it )
...
Dim xmlnode As XmlNode
Dim xmlelement As XmlElement
Dim xexpr As XPathExpression
...
Try
xexpr = XPathExpression.Compile("//directory[@Path=" & "'" & tpath & "\" & xnode.FullPath & "']")
xmlnode = xDoc.SelectSingleNode(xexpr.Expression)
'marked element
xmlelement = xmlnode
xmlelement.SetAttribute("marked", 1)
'files and directory under the marked element
For Each xmlelement In xmlnode
xmlelement.SetAttribute("marked", 1)
SetAttr(xmlelement, 1)
Next
xDoc.SelectSingleNode(xexpr.Expression).ParentNode.ReplaceChild(xmlnode, xDoc.SelectSingleNode(xexpr.Expression))
Catch ex As Exception
MsgBox(ex.Message)
Finally
xDoc.Save(filename)
End Try
|
|
|
|
|
I'm glad I could help. Your code looks quite good, but I think it could be simplified a bit. As far as I know the SelectSingleNode method creates no copy as the ReadNode method does, so there is no need to replace nodes and the following should work to:
Dim xmlnode As XmlNode
Dim xmlelement As XmlElement
...
Try
xmlnode = xDoc.SelectSingleNode("//directory[@Path=" & "'" & tpath & "\" & xnode.FullPath & "']")
'marked element
xmlelement = xmlnode
xmlelement.SetAttribute("marked", 1)
'files and directory under the marked element
For Each xmlelement In xmlnode
xmlelement.SetAttribute("marked", 1)
SetAttr(xmlelement, 1)
Next
Catch ex As Exception
MsgBox(ex.Message)
Finally
xDoc.Save(filename)
End Try
"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,
Three or four times a year i need to write an XPath statement. Every time I seem to have forgotten how to get it to work and every time i try to follow the examples on the internet , especially here and w3schools and everytime i still find it really hard to work out how to get my queries to work right.
What i find hardest is that I write syntactically valid xpath and just get back no records. I then don't know if i'm looking too high or low in the tree or if i got a typo etc.
Is there a more visual way of building XPath statements?
Thanks
Russell
|
|
|
|
|
|
Thanks,
In the end I realised I'd been slack and not defined a default namespace for the document while also relying on a webservice to cast from a string containing xml to an XMLDocument and .Net had kindly added a namespace for me.
That tool looks like it'll be very interesting in the near future, I seem to be descending into XML coding more and more having hovered around the edges of it for several years.
Thanks again,
Russell
|
|
|
|
|
Hi,
I have an XML file as input. I need to create another XML File by adding some data. I am using Biztalk to map them.
The input File looks like
<ns0:Root xmlns:ns0="http://Test_MBP.MBP">
<Record1>
<Field1>Record1FirstField1</Field1>
<Field2>Record1FirstField2</Field2>
<SeqField1>Record1FirstSeqField1</SeqField1>
<SeqField2>Record1FirstSeqField2</SeqField2>
<SeqField1>Record1SecondSeqField1</SeqField1>
<SeqField2>Record1SecondSeqField2</SeqField2>
</Record1>
<Record1>
<Field1>Record2FirstField1</Field1>
<Field2>Record2FirstField2</Field2>
<SeqField1>Record2FirstSeqField1</SeqField1>
<SeqField2>Record2FirstSeqField2</SeqField2>
<SeqField1>Record2SecondSeqField1</SeqField1>
<SeqField2>Record2SecondSeqField2</SeqField2>
<SeqField1>Record2ThirdSeqField1</SeqField1>
<SeqField2>Record2ThirdSeqField2</SeqField2>
</Record1>
</ns0:Root>
The output i recieved at the moment is as follows
<ns0:Root xmlns:ns0="http://Test_MBP.henryLM">
- <REC01>
- <Record1>
<const>01</const>
<Field1>Record1FirstField1</Field1>
<Field2>Record1FirstField2</Field2>
- <Rec02>
- <Record2>
<Field3>Record1FirstSeqField1</Field3>
<Field4><b>Record1FirstSeqField2</b></Field4>
<const>02</const>
</Record2>
- <Record2>
<Field3>Record1SecondSeqField1</Field3>
<Field4><b>Record1FirstSeqField2</b></Field4>
<const>02</const>
</Record2>
</Rec02>
</Record1>
- <Record1>
<const>01</const>
<Field1>Record2FirstField1</Field1>
<Field2>Record2FirstField2</Field2>
- <Rec02>
- <Record2>
<Field3>Record2FirstSeqField1</Field3>
<Field4>Record2FirstSeqField2</Field4>
<const>02</const>
</Record2>
- <Record2>
<Field3>Record2SecondSeqField1</Field3>
<Field4>Record2FirstSeqField2</Field4>
<const>02</const>
</Record2>
- <Record2>
<Field3>Record2ThirdSeqField1</Field3>
<Field4>Record2FirstSeqField2</Field4>
<const>02</const>
</Record2>
</Rec02>
</Record1>
</REC01>
</ns0:Root>
Some how i cant understand why biztalk gives the old values for "field4".
The structure required is correct but some how data is wrong for the node "Field4" in "record2" element.
can some help me out thanks............
|
|
|
|
|
I have downloaded from a website xml menu code.This includes a Horizantal menu and Vertical Menu of XML and XSL Files respectively. There is one Menu java script file and a Css file . The Download folder also includes code, default and help aspx files.How to display the XML menu . There is know html file loaded with all this files into it.
//Floder
Code.aspx
Default.aspx
Help.aspx
Menu.css
menu.js
vmenu.xml
vmenu.xsl
hmenu.xml
hmenu.xsl
Praveen
|
|
|
|
|
No html file needed, as the menus are probably used by the aspx files. Those are part of the ASP.NET technology and similar to php files allow you to create dynamic pages. Therefor they need to be processed by a special web server which then returns a html page to the client. Such a web server that allows you to run the aspx pages on your local systems is included in the free of charge Visual Web Developer 2005 Express Edition[^]
"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 trie to display a greeting Message in an html by redaing the words from xml.This was a my first simple progrma on xml.Use XMLDOM to load xml and xsl to memory.Transfomed into html. The html page dispplay only words of greeting.It doesn't display the text read from xml.
This my xsl code:
<body> words of greeting:
xsl:value-of select="greeting"
</body>
The Xml code
Hello world.
Praveen
|
|
|
|