Jump to content

msphelix

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by msphelix

  1. Hi,The XML DOM Tutorial sample file, books.xml, has a book node with 5 author nodes = multiple elements of the same type: <book category="web"> <title lang="en">XQuery Kick Start</title> <author>James McGovern</author> <author>Per Bothner</author> <author>Kurt Cagle</author> <author>James Linn</author> <author>Vaidyanathan Nagarajan</author> <year>2003</year> <price>49.99</price> </book> I understand doing it this way but I would tend to group the 5 authors as 5 sub-elements of one author element: <book category="web"> <title lang="en">XQuery Kick Start</title> <author> <data>James McGovern</data> <data>Per Bothner</data> <data>Kurt Cagle</data> <data>James Linn</data> <data>Vaidyanathan Nagarajan</data> </author> <year>2003</year> <price>49.99</price> </book> The pros of doing it the Tutorial's way are a smaller file and slightly easier access to the actual author names.The con is that, to me at least, it makes it harder to see all of the authors - I actually said "a book node with 2 author nodes" before I looked more closely.The pro of doing it my way is that all of the actual author data is in one element separate from the other elements and, for me at least, easier to see.The con is a bigger file and slightly more difficult access to the actual author names.My questions are:is there an XML standard that says the Tutorial's way is THE way it should be done?would someone looking at my XML think it was not up to standard?if there is no standard, which method do you prefer and why?Thanks
  2. Thank you. That works :)Can you give me a URL to a page that lists the available escape sequences for XML? > Never mind. I found it.
  3. Hi,I want to put the following text (note the < at the end)I ADVISE YOU TO PUT DOWN THE CLAM BEFORE OPENING IT. >STRAIN!<in an element as follows<data>I ADVISE YOU TO PUT DOWN THE CLAM BEFORE OPENING IT. >STRAIN!<<\data> When I open this in a browser (to check for correctness), the browser complains about the two << characters, one from the actual text, the other from the closing tag <\data>. How can I get what I want? Thanks.
  4. Hi, I am displaying Nodes from the following XML file in a Java GUI.<?xml version="1.0" encoding="ISO-8859-1"?><bookstore> <book category="cooking"> <title>Everyday Italian</title> <author>Giada De Laurentiis</author> </book><!-- more book elements --></bookstore>I haveElement documentElement = xmlDocument.getDocumentElement();andNodeList bookNodes = documentElement.getElementsByTagName("book");I want to allow the user to remove all <book> elements while not destroying xmlDocument - I want the user to be able to add <book> elements to the same Document even after removing all of the existing elements.I can do this by running bookNodes from tail to head, getting each element, and calling documentElement.removeChild(thisElement).ButIs there a way to do this in one call?documentElement.removeAll();Thanks.
  5. dsonesuk,Thanks, that worked
  6. Foxy Mod,I'm using Firefox.I know how to use lists and list-style; that's not what I'm doing here.The w3schools CSS tutorial says display:list-item should style an item by giving it a bullet as if you were using a list. I don't know why you would want to do it with display instead of using a list but because they say you can, I'd like to know why it isn't working for me.See the w3schools CSS Reference for the display property: it shows an example where they create a <span> element with a red background and display:list-item and it shows the bullet. I just copied their code into my own html file and it doesn't work. If you don't know t he answer is there some way I can contact w3schools to ask them and actual get a response?thanks
  7. Hi,I'm testing out/learning CSS and applied the following style:#listitem{ display:list-item; color:red;} as follows:<p id="listitem">Why not just use a list?</p> I know the style works because the text was correctly red, but it did not display as a list-item = no bullet.Am I missing something?How do I get it to work?Thanks
  8. As far as I can tell anything I can do with max-height, max-width, min-height, and min-width I can do with height and width - what are they suppose to do that only they can do?
×
×
  • Create New...