|
Stefan Troschütz wrote: Nothing is impossible
Indeed, but the site I am thinking about is not built with ASP.NET. It is running on Apache.
|
|
|
|
|
Ok, do you use any kind of server-side-technology like PHP or JSP on your apache server? Maybe they have some built-in support for localization too. If not, i'm quite sure that it is possible with JSP to apply an XSLT stylesheet to an XHTML source that inserts language-specific text to certain elements. I have alomost no experience with PHP, so it's hard to say how chances are to implement such thing with this technology.
"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
|
|
|
|
|
PHP is available.
BTW, I am not willing to use JavaScript (or anything that runs on client), because more and more people disable its support in their browsers.
|
|
|
|
|
Hi,
I work on an xml project using xerces integrated to the MS VC++ 6.0 environment (msdev). I need to integrate xerces with MS Visual Studion 2003 (devenv).
The following are the setup options I create with the VC++ 6.0
a. Project Setting -> C/ C++ tab -> Category : Preprocessor ->Additional Include Directory : <path where="" xerces="" is="" stored="" till="" the="" src="" folder="">
b. Project Setting -> Link -> Category : Input -> Object/ Lib Modules : Xerces-c_2D.lib and Addtional lib path : <directory where="" the="" lib="" file="" is="" stored="">
Xerces works fine with this.
When I try the same with MS VS 2003, i get linker errors indicating that there is a clash between the MSXML and xerces' functions definitions. What Should I do to resolve this issue. Please help
|
|
|
|
|
When you "#import" MSXML, don't use the no_namespace attribute or use the rename_namespace attribute. Using a namespace will resolve your clashes.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
hi,
i need some help regarding data access from XML sent by web services.
I have a web service that sends out XML as its result, as below:
<?xml version="1.0" encoding="utf-16"?>
<Response webMethodId="GetUserListing">
<SecurityContext sessionId="154oe1upayjpnx55pg1f3r45" />
<Document>
<ArrayOfUsers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<User>
<UserId>32</UserId>
<Name>foxtrot</Name>
<Address>Suite 712</Address>
<Zip>12345</Zip>
<PhoneNumbers>
<string 111-111-1111/>
</PhoneNumbers>
<Emails>
<string>foo@foo.bar</string>
</Emails>
</User>
</ArrayOfUsers>
<TotalRecords>25</TotalRecords>
</Document>
</Response>
In the RDL file, the Query i specify is:
<Query>
<Method Namespace ="http://tempuri.org/" Name = "ProcessRequest" ></Method>
<SoapAction>http://tempuri.org/ProcessRequest</SoapAction>
</Query>
and the result i get is in a single line that says ProcessRequestResult, with the XML specified above in a single line. however, i need the result in a tabular form, which would give me records of different users, one below the other.
if i specify the <ElementPath> element for the query, i do not get any response at all.
The <ElementPath> element i specify is:
<ElementPath>Response{}/SecurityContext{}/Document{}/ArrayOfUser{}/User</ElementPath>
i need urgent help for this and any help would be appreciated.
Thanks in advance
Deepali
|
|
|
|
|
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
|
|
|
|