|
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.
|
|
|
|
|
Hi all,
am new with xml, so may be the question is not very correct. I have the xlm description of the electonic shema. This description includes nodes (i.e. transistors, resistors ...) and wires. Now I want to visualize the circuit with intenet explorer. I have somehow to make IE to understand, that when it meet in XML transistor it has to take the picture transistor.gif... After all elements are placed it has to draw the wires in the optimal way (route on the fly?I have an algorithm but don't know where to put it in xml).
I have absolutely no idea how XML can be visualized. Please could you give me the starting point.
Thanks,
Boni
|
|
|
|
|
hi Boni,
oh oh... i only see lots of xslt and javascript and CSS or plug-in to IE. Yeah, plug-in shoud be better option, but still it's quite difficult I think (I never made any plugin). At least, it is possible to archive your goal However, IMO its far easier to make win app for it instead of use IE.
best regards,
David 'DNH' Nohejl
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
Hi David, hi all
thank you very much for your reply.
I have now easier question. Lets leave the routing outside (As far as I understand you javascript and plug-in are from routing, right?). How can I say the IE that if it meets a tag "Transistor" to take a picture "transistor.gif". Is it easy? Do I supposed to use XSLT or CSS? (sorry, I don't know much about both and the resources I could find so far about XSLT was not very clear. On other side I use CSS to change font colors on the page and so on, but don't know how it can help to solve my problem.)
Thanks alot,
Boni
|
|
|
|
|
Hi Boni,
Boniolopez wrote:
How can I say the IE that if it meets a tag "Transistor" to take a picture "transistor.gif"
You actually don't say it to IE. Yes, you are supposed to use XSLT. What XSLT do? You have some XML document, and in XSLT you say how to transform it. Result of transformation is usually another XML document, but not allways. You can have XSLT transformation which will output CSV, plain text or whatever. So you will have XLST which will transform XML tag "Transistor" into tag "<img src='transistor.gif' />" The point of use CSS is in absolute positioning, which allow you to arrange images on page.
Example: <img src='transistor.gif' style='position:absolute;left:5px;top:5px'>
will render image with upper-left corner 5 pixels from top of the page and 5 pixels from left border .
btw I've learnt XSLT from (MSDN[^]) I think it's good for u to learn it too (whereever), cuz I think XSLT is very powerful and useful technology... It's not so difficult as it might look
I hope these information are helpfull... I don't want to write it all, a) it would be so loong post
b) I want to leave something for u
David
Never forget: "Stay kul and happy" (I.A.)
|
|
|
|
|
I have wrote, using C# a tool that will read Word Documents (with specific formatting) into XML files. The software will be used for a publishing house. The issue is that I would like to give the users a search engine that will enable them to search for a word in all the XML files, and once found high light all the instances...
Are there ready made, customizable xml search engines or is it something that I have to build
Elie
|
|
|
|