|
Hi There,
I need to provide intelligent xml editor feature in a WinForm window application. I am thinking about hosting the .NET xml designer but couldn't find if it is
possible and how to proceed if it is possible. If you have experience regarding this or using some other xml editor, I would appreciate your feedback.
Thanks in advance,
John
|
|
|
|
|
I am looking for a good article about the cost of using XML and the resultant Serialization that is required - compared to using binary representation
Can anybody help?
|
|
|
|
|
|
What are the simple ways to validate an xml document against a schema, I am looking at XmlValidatingReader, which seems to be the solution,does anybody have a full piece of code I can try?
Berlin Brown
GIS Developer
http://www.retroevolution.com
|
|
|
|
|
hi,
it is very simple... i don't have full code, bt I don't think it is a problem.
I am working on app where I validate XML against my XSD:
this method reads XML with XmlValidatingReader
<br />
public void ValidateStg(String URL)<br />
{<br />
XmlValidatingReader r = new XmlValidatingReader(new XmlTextReader(URL));<br />
try<br />
{ <br />
r.ValidationType=ValidationType.Schema;<br />
r.ValidationEventHandler+=new System.Xml.Schema.ValidationEventHandler(r_ValidationEventHandler);<br />
r.Schemas.Add(null,"http://localhost/mySchemaExample/Schema.xsd");<br />
while(r.Read())<br />
{<br />
<br />
}<br />
}<br />
finally<br />
{<br />
r.Close();<br />
}<br />
}<br />
there is handler called when there is some problem ( I write down error message into xml log):
<br />
private void r_ValidationEventHandler(object sender, System.Xml.Schema.ValidationEventArgs e)<br />
{<br />
XmlDocument doc = new XmlDocument();<br />
doc.Load(@"C:\Inetpub/wwwroot/mySchemaExample/report.xml");<br />
XmlElement el = doc.CreateElement(null,"error",null);<br />
el.InnerText = e.Message;<br />
doc.DocumentElement.AppendChild(el);<br />
doc.Save(@"C:\Inetpub/wwwroot/mySchemaExample/report.xml");<br />
}<br />
As you see, it is really simple.
best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Hi,
Can anyone tell me if it's possible, by using DTD to prevent elements having identical attribute content. The element and attribute names can be identical as shown in the example below.
e.g., this should cause validation to fail ...
<MyElem MyAttrib="10"/>
<MyElem MyAttrib="10"/>
Thanks !
|
|
|
|
|
Hmm.. use ID type which quarantees that the values are unique?
e.g. <!ATTLIST MyAttrib type ID>
|
|
|
|
|
Have any one a method to read a data from a xml with XPath expression document and view a result with a datagrid
sorry for interruption
Ehab Nady
|
|
|
|
|
Can't you turn an XML document into a dataset ? If not, I wonder if a nodecollection would work, seeing as it's an array.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Here is my document:
<br />
<br />
<data><br />
<meetings><br />
<meeting id="900" title="Meeting Title" date="1/1/2005" location="Main Office"><br />
<attendee personID="100" /><br />
<attendee personID="101" /><br />
</meeting><br />
</meetings><br />
<people><br />
<person id="100" firstname="John" lastname="Doe" /><br />
<person id="101" firstname="Jane" lastname="Smith" /><br />
<person id="102" firstname="Jack" lastname="Williams" /><br />
</people><br />
</data><br />
<br />
I want to be able to display the meeting info, then display a table of meeting attendees. When displaying attendees, I want to match their related person info in a different node in the document. e.g. the desired output for the single meeting above would be:
Meeting Title, Main Office, 1/1/2005
John Doe
Jane Smith
Here is how I'm approaching it:
<br />
<xsl:template match="/data/meetings/meeting"><br />
<xsl:for-each select="attendee"><br />
<p><br />
<xsl:value-of select="/data/people/person[@id=@personID]/@firstname" /><br />
<xsl:value-of select="/data/people/person[@id=@personID]/@lastname" /><br />
</p><br />
</xsl:for-each><br />
</xsl:template><br />
The stylesheet loads fine, but there is no output for each person. If I hard-code the @personID value in the query I'm using to get to the specific person, then it works fine. Where am I going wrong?
Michael Hodnick
www.kindohm.com
|
|
|
|
|
Hi,
this tries to select person whose id is same as personID.
(it would work with data like this:
<person id="100" personID="100" firstname="John" lastname="Doe" /> )
You need to tell parser, that attribute personID is not atribute of person tag, but attribute of attendee tag. I'm not sure if I'm correct, but try something like this:
<xsl:value-of select="/data/people/person[@id=./@personID]/@firstname" />
Hope this helps
|
|
|
|
|
Hi,
I have been searching for a Parser that will parse both RSS and ATOM feeds. So far i have found numerous of RSS and a number of ATOM only parser (Not both) that were written in .NET.
I was wondering if anyone can point me in the right direction of know of any such projects in .NET.
So far, the only parser i seen that parses both is one from Magpie (php) and Unvieral.... (python).
Thanks
|
|
|
|
|
Hi all,
I have got one schema, in which i want to give maxOccurs of a node to 3 and problem is it is not necessary to be in xs:sequence, but if i keep xs:all then according to the rules maxOccurs have to be 1, how can i solve the problem, please let me know it is very urgent.
Het
Be Humble in Victory and Strong in Defeat. -Het
|
|
|
|
|
sory, if this was asked before
I wanna ask for help. I liked to post xml file from one page to another page that cross paltform , from C#.Net to java. So I want to pass xml file like using http post and i can get xml file from http get. Can anyone help me write in C#,net web application?
Thanks very much. Sory if my language was poor.
|
|
|
|
|
hi (lighting_blue? ),
I don't know if this is right forum... your problem has nothin to do with XML/XSL, since you don't care about format of file when GETting or POSTing it. look at HttpResponse and HttpRequest classes (in System.Web namespace)
I can't help with Java side...
What about XML Web Services, btw?
best regards,
David 'DNH' Nohejl
------
btw ur language would be better if you wrote "sorry" ( or "sry" abbrevation) instead of "sory". But I should shut up, cuz my english is not (much) better.
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Hello everybody. I'm writing from Seville, Spain. I'm trying to build a Test-generator application through a shared add-in hosted in Word, and I need to transform .xml documents to other formats like .doc, .html and .rtf. I'm convinced that possibly there are libraries, components or classes that allow these transformations.
Does anybody know something about this respect??
Has anybody ever been in a similar situation??
Thank u very much
makay
|
|
|
|
|
hi Makay,
I belive Word (at least latest version) can do a lot of work for you. I am in similar situation, cuz I have to convert XML data into .doc. I'm gonna do it using XSLT transfomation (XML->HTML) and then simply load HTML file into Word and save it like a .doc (using automation).
Best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
I'm writing a small application that is supposed to get metadata from an SQL server database and store that information as xml.
Here is a part of an example xml file:
<database name="the_name">
<structure>
<table name="table_name">
<pk>PK</pk>
<column name="PK">
<type>int</type>
<identity>
<startvalue>5</startvalue>
<increment>2</increment>
</identity>
</column>
The <identity> part is optional for each <column>. So what I want is an xpath expression that can get me the name of the <column> that has an <identity> part.
I tried these two expressions. They dont get the name of the column but I thought it would get the <column> node atleast:
/database/structure/table[@name='" + tableName + "'/column/identity]
/database/structure/table[@name='" + tableName + "'][/column/identity]
Here 'tableName' is a variable I insert there, and the name of that is correct.
Anyone knows how to do this? Is it even possible with one xpath expression?
|
|
|
|
|
For your example, try this:
"/database/structure/table[@name='" + tableName + "']/column[identity]/@name"
Evaluating this in XMLSpy (after substituting the table name, obviously) gives me the name attribute with value 'PK'. Adding more columns with an identity child element leads to their names also being returned.
HTH
Stuart Dootson
'Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p'
|
|
|
|
|
Hi All,
I have a doubt regarding XML elements naming.
Let say I have an XML document having an element
called .
If I add a sub-element to the element with the
same name for e.g.
Is the above structure recommendable?
Will this structure cause any problems while parsing the XML file
using MSXML DOM parser?
Please guide me.
Thanks in advance,
Abhishek.
|
|
|
|
|
Hi all,
once more starter question.
I am starting with XML and XSLT. I created XML document and XSLT to it. But the IE shows to me not what I expect. Can I somehow see the HTML, which comes after the transformation? (Or how can I debug my stuff?)
Thanks,
boni
|
|
|
|
|
show some source, plz...
Boniolopez wrote:
But the IE shows to me not what I expect.
What does it show?
btw It's good to see that you are starting with XSLT
If I saw this post litle earlier, I would not suggest u this in post above
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Hi Dave,
thank you for your very clear answer in my previous posting. Now I understand the idea, and what I have to do.
Algthouth I don't think, that it is worse to post my XSL errors into forum so far . . The question is how can I debug the output of the transformation myself. I want to see the HTML code, which is generated after the transformation, but if I make "show source" in the IE, it shows the XML before the transformation. Is it some magic too, whic looks like
magic_tool input.xml input.xsl >output.txt
Thanks in advance,
boni
|
|
|
|
|
Boniolopez wrote:
if I make "show source" in the IE, it shows the XML before the transformation.
Of course it does. Original XML is real source stored in file, isn't it? If you want to see transformed source, transform your XML into HTML, then save transformed HTML into file and only then open this file in IE. If you work in .NET, magic tool can be XslTransform class for System.Xml.Xsl namespace. Write little app which saves transformed XML into HTML file or something like that. With MSDN or google it won't be difficult task.
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Thank you for your great help.
|
|
|
|