|
Hi There,
Sorry but do you think any one will bother to answer you on that ! this is a newspaper for god sake !
Sincerely Samer Abu Rabie
Imagination is more important than knowledge !
|
|
|
|
|
I am reading this code
-<Set xsi:schemaLocation="urn:htt://www.exaple.com ">
-<Result>
<Title>Title of the page </Title>
I can read an simple XML through XpathNedeIterator but in <set> Node you can see data xsi;...
How can I handle this
I am using this
XPathNodeIterator nodes = navigator.Select("//Set//Result//Title");
to get title value XPathNavigator node = nodes.Current;
but I am fail I search at Google but not successful Any suggestion
thanks in advance
|
|
|
|
|
i m sending the blow request to the server for oim and i m getting error the server response is also below
this is my request
POST /OimWS/oim.asmx HTTP/1.1
Host: ows.messenger.msn.com
Accept: */*
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; Windows Live Messenger 8.0.0812)
SOAPAction: http://messenger.live.com/ws/2006/09/oim/Store2
Content-Type: text/xml; charset=utf-8
Content-Length: 1888
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><From xmlns="http://messenger.msn.com/ws/2004/09/oim/" memberName="amit0902@hotmail.com" friendlyName="=?utf-8?B?YW1pdDA5MDJAaG90bWFpbC5jb20NCg==?=" xml:lang="en-US" proxy="MSNMSGR" msnpVer="MSNP15" buildVer="8.5.1288"/><To xmlns="http://messenger.msn.com/ws/2004/09/oim/" memberName="geodesic4@hotmail.com"/><Ticket xmlns="http://messenger.msn.com/ws/2004/09/oim/" appid="PROD0119GSJUC$18" lockkey="" passport="t=EwDQAfsBAAAU6YkiHMZzuZ4UDDW/bI8JLiYB/FmAAOGTgPkb5BP5QOI0mWiavFln07+F/N29EbTMdLNypxEjDv5AJtK3Mnhf+/NboMA63ovbTB+5hQL9nQDUYT0XqSPzskaYgOmg0Yzdu+pj/4Z9a/TuxZ6b6s6VUrLzwrvb7I/6yxH+CqQ22lzksnkw18l5xlSYK/DMy2uTpiVGH9NSA2YAAAi+DCLKu1ca0iAB3A186Ncp46GYFAQHX3YtPtZm/LqPO6OLxnql64UB5R2PVEZC6DA6ZZPoYTzNGEv+NkguFxQT6cgxmXLIAqvRYMCp5G56x7Nn01Zqf+yXB
YmGlxKWu71lZuhibFjEXoNvMbLBABqX91Kdw0Ov7K8VNSu/uNFvt28DtS383qxdrQ0LAeMic3oWRNqVOr8xsjIm9A/Rm445zCbKOYibZpT5OkWJnKYH0ny1jMUqq//vlr48A7GiRJtpoplbRVsKYGRiVbTGV7K3yXVRuEpWW104inclputmQaTYHr0gipo+gK5Nzb0u3Zoh1oB
vau1gDRUSnW2WyBIwQd+0a6phejyLXsufNyQn9J3rg2Xej2Jmi2VCK1GpPBxm6+qBnZY+WTY+SAE=&p="/><Sequence xmlns="http://schemas.xmlsoap.org/ws/2003/03/rm"><Identifier xmlns="http://schemas.xmlsoap.org/ws/2002/07/utility">http://messenger.msn.com</Identifier><MessageNumber>1</MessageNumber></Sequence></soap:Header><soap:Body><MessageType xmlns="http://messenger.msn.com/ws/2004/09/oim/">text</MessageType><Content xmlns="http://messenger.msn.com/ws/2004/09/oim/">MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: base64
X-OIM-Message-Type: OfflineMessage
X-OIM-Run-Id: {83BF3DE7-4E7D-5BF2-7895-29CF5934114C}
X-OIM-Sequence-Num: 1
aGVsbG8A</Content></soap:Body></soap:Envelope>
and server gives me the response
HTTP/1.0 500 Internal Server Error
Cache-Control: private
Content-Length: 602
Content-Type: text/xml; charset=utf-8
X-AspNet-Version: 2.0.50727
Date: Tue, 05 May 2009 06:06:59 GMT
X-Cache: MISS from seepzint.geodesic.net
X-Cache-Lookup: MISS from seepzint.geodesic.net:3128
Via: 1.0 seepzint.geodesic.net:3128 (squid/2.6.STABLE21)
Connection: close
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Header><Machine name="BY2MSG3020613" ver="8.22.430.1" xmlns="http://messenger.msn.com/ws/2004/09/oim/" /></soap:Header><soap:Body><soap:Fault><faultcode xmlns:q0="http://messenger.msn.com/ws/2004/09/oim/">q0:InvalidParameter</faultcode><faultstring>Exception of type 'System.Web.Services.Protocols.SoapException' was thrown.</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>
will anybody tell me how can i resolve this invalid parameter error.
|
|
|
|
|
Good Morning to all
I have following data in xml file
<StudentInfo>
<student rollno="101">
<name>ABC</name>
<contactNo>9926090838</contactNo>
<email>sumitprakash_sharma@yahoo.com</email>
</student>
</StudentInfo>
now as we see all the values is in proper data type ie .
rollno integer
name string
contactNo long
email string
now i want to validate user to enter the information in proper data type
so please tell me how can i validate user to insert proper data
|
|
|
|
|
Sumit Prakash Sharma wrote: how can i validate user to insert proper data
Depending on your requirements you might be able to use a Schema and a Validating Parser. Otherwise you will have to perform validation using a programming language.
|
|
|
|
|
Hi all,
I am looking for some documentation of using macros or functions within XML.
The program, Zotero, stores it data in a modified form of XML they call CSL.
I am looking for means of manipulating authors that are all in uppercase within the controlling XML Reference Style, and capilizing the first letter then making the rest lowercase.
e.g. lastname, LASTName, LastName --> Lastname.
I would also like to capture things like McEwan and O'Reily. These simple types of text manipulations are found in many languages, e.g. lower(), upper(), proper() and instr(). What are the equivalents for use in XML?
Simon
|
|
|
|
|
SimonCropper wrote: I am looking for means of manipulating authors
I am guessing that means the Text context of a TextNode which is of course a child of an ElementNode. It might be possible to accomplish this using Javascript and an XSLT Processor that supports user functions. I think I remember using one of the Microsoft Processors that supports that, perhaps they all do, I don't know because I would not use that mechanism unless I had no other choice.
Fortunately, in this case you have another choice. Using a compiled programming language (C#, C++, whatever), load the file in a DOM, query for the elements of interest, read the current Text, modify the Text (your capitalization), write it back into the element. Finally the last step would be to persist the changed XML back into it's storage location, e.g. Disk File or Database or whatever.
|
|
|
|
|
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
|
|
|
|
|
Hi guys!
I'm looking for a way to find out if there's an assembly redirection for a given assembly in an app.config file.
Let's say I have ClassLibrary1 version 1.2.0.0 and I want to find out if my app.config file already contains an assembly redirection for version 1.0.0.0 to 1.1.0.0.
I'm afraid my XPath knowledge is not up to this task - I don't know how to combine conditions from different nodes.
I have this XML snipplet:
<dependentAssembly>
<assemblyIdentity name="ClassLibrary1" publicKeyToken="..." culture="neutral" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
and I want to get the dependentAssembly node with an assemblyIdentity child with @name='ClassLibrary' AND a bindingRedirect child with @oldVersion='1.0.0.0'
Is this possible with XPath and if so, how?
Thanks in advance
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Looks as if I was just missing a small step - I think I can answer my own question
For those interested: An XPath finding only the nodes I wanted is
//assemblyIdentity[@name="ClassLibrary1"]/../bindingRedirect[@oldVersion="1.0.0.0"]/..
Nevertheless - if someone else knows a better way I'm always willing to learn.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
I have a question about a SAX parser versus a DOM parser in terms of memory usage...
I know that in terms of memory usage a SAX parser uses significantly less memory because of it's event based nature. However, in this example of a Model based SAX parser (see link below) it looks like this still reads the entire XML document into memory because of the way it creates instances of any classes that it needs to and builds lists of the objects. It seems to me that this would still be reading the entire document into memory like a DOM parser would. I may be wrong of course which is why I'm posting here...
Any insite would be greatly appreciated...
http://www.onjava.com/pub/a/onjava/excerpt/learnjava_23/index2.html?page=1[^]
|
|
|
|
|
Josh Owen wrote: However, in this example of a Model based SAX parser
Josh Owen wrote: It seems to me that this would still be reading the entire document into memory like a DOM parser would.
The example may well be doing that, but that is not the authors point, this is:
What may be harder to see is how one could use SAX to build a real Java object model from an XML document.
His example is how one could use a the SAX Parser to serialize the XML into a Java Object Model. What that model might be is completely up to you, and therefore does not have to be the entire document. Neither would it have to represent the XML, Node Types and Names etc., but rather your objects.
Was that what you were asking?
|
|
|
|
|
Sure I understand that his point is to show how to build a Java Object Model using the SAX parser but my question is that he says this:
"The primary motivation for using SAX instead of the higher-level APIs that we'll discuss later is that it is lightweight and event-driven. SAX doesn't require maintaining the entire document in memory."
Then goes on to give that example when I'm fairly certain that example uses the same amount of memory a DOM parser would. But I may be wrong? So that's what I am trying to clarify. Do you think that example does actually use the same amount of memory as a DOM parser would?
Thanks for the quick response...
|
|
|
|
|
Josh Owen wrote: Do you think that example does actually use the same amount of memory as a DOM parser would?
I don't know, it is certainly possible. I don't understand the significance of that. The authors point, and it is a well known one, is that SAX parsers use less memory and are faster than DOM parsers. I have never studied the implementation of these parsers but the significant difference is that a DOM parser generates a DOM where a SAX parser does not. It is this generation of a DOM that consumes so much more memory and requires more processor instructions.
However if you use a SAX parser to create the same information as a Document Object Model does then you would be re-creating the DOM parser scenario at which point there is no benefit in using SAX. The authors point is, if your model does not need the entire document structure then using SAX to generate your own model will be faster (and use less memory) than generating a DOM and pulling the information out of it to build your model.
Does that help?
|
|
|
|
|
Thanks, yeah I have no issue with what the author's point is. I understand what the differences between SAX and DOM are. I was going to recreate a DOM parser I had created as a SAX parser but I need the ability to jump around a little bit which is why I was going to use this Java Object Model. But once I started reading about it I was thinking that this may all be for naught because even though I'm using SAX it is stil storing everything in memory and therefore using the same amount of memory as a DOM parser.
Thanks for the response
|
|
|
|
|
Hi,
I have included the degree symbol in a xml file using ° and now i need to parse the contents in the xml file into a html file. After parsing the special character (°) is displayed as ° in html file.
Vb code used for parsing:
-------------------------
dim xmldom
Set xmldom = CreateObject("Msxml2.DOMDocument.4.0")
xmldom.load "C:\Tmp\sample.xml"
If not xmldom is nothing then
xmldom.save "C:\Tmp\sample.htm"
msgbox "Html file written"
End If
Could any one help why the degree symbol is not get included in the html file correctly ?
|
|
|
|
|
|
Hi,
I have included the degree symbol in a xml file using ° and now i need to parse the contents in the xml file into a html file. After parsing the special character (°) is displayed as ° in html file.
Vb code used for parsing:
-------------------------
dim xmldom
Set xmldom = CreateObject("Msxml2.DOMDocument.4.0")
xmldom.load "C:\Tmp\sample.xml"
If not xmldom is nothing then
xmldom.save "C:\Tmp\sample.htm"
msgbox "Html file written"
End If
sample.xml file
----------------
<root>
<specialc>°
Could any one help why the degree symbol is not get included in the html file correctly ?
|
|
|
|
|
In order to include the degree symbol in your XML document, it can be represented as ° .
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Sorry, forgot to tick the ignore HTML box:
Can I get the special xml strings (< & etc) directly instead of being translated?
For example, given the data "<data>RCI></data>", the code:
xmlReader.ReadStartElement("DATA");
data = xmlReader.ReadString();
xmlReader.ReadEndElement();
Gives: "RCI>". Can I get the raw "RCI>" and if so, how?
Thanks
|
|
|
|
|
Try this u will get "RCI>"
xmlReader.ReadInnerXml()
|
|
|
|
|
pass each string in the following function, and you will always get the right result:
Public Function MakeXMLString(ByVal text As String) As String
text = text.Replace("&", "&")
text = text.Replace("'", "'")
text = text.Replace("""", """)
text = text.Replace("<", "<")
text = text.Replace(">", ">")
Return text
End Function
good luck!
|
|
|
|
|
Let say I have this:
<td id="manufacturer{generate-id(model)}"><xsl:value-of select="manufacturer"/> </td>
<td><a href="#" onclick="AddRemoveItem('Add',{generate-id(model)});" >Add</a></td>
The {generate-id(model)} inside AddRemoveItem() function does not appear. Am I putting it wrongly?
|
|
|
|
|
I read somewhere I could pass parameter like this:
$manufacturer = $_POST['manufacturer'];
$cameraType = $_POST['camType'];
$priceRange = $_POST['priceRange'];
$params = array('maker' => $manufacturer,'camType' => $cameraType,'pRange' => $priceRange);
$xsltTransformer=xslt_create();
$htmlOutput=xslt_process($xsltTransformer,"camera.xml","camera.xsl", NULL, array(), $params);
xslt_free($xsltTransformer);
or
$htmlOutput=xslt_process($xsltTransformer,"camera.xml","camera.xsl", $params);
and my xslt will have this:
< xsl:param name="maker">All< /xsl:param>
..so on
Which doesnt work and return always 'All'. I am using Sablotron library for transformation.
How can I pass parameter correctly?
|
|
|
|
|
Hello,
My application receives XML files from users submitted via web. It then reads and loads them in the SQL Server database using a C# routine. The file sizes are like 2/3 megabytes. The web validation (XML schema and other checks like existence of valid data ids etc.) takes long - sometimes 30 sec to 1 min.
What would be a better way to improve performance - possibly not using this C# parser?
I would highly appreciate ideas.
Thanks.
|
|
|
|