Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


is XML what I want here?

From: John Salerno <johnjsal@-----------.--->
To: NULL
Date: 3/3/2006 10:24:00 PM
Hi everyone. I thought I might do a little experiment with XML and type 
up some rules for syntax formatting for a programming language. But I'm 
a little confused about how to format the XML file. My first thought was 
I might do this in HTML instead, and I think I sort of wrote the XML 
file with HTML syntax in mind. Needless to say, nothing is nested properly:

<?xml version='1.0' encoding='utf-8'?>

<category>Code Layout</category>
	
	<subcategory>Indentation</subcategory>
	<rule>Use 4 spaces per indentation level.</rule>
	
	<subcategory>Tabs or Spaces</subcategory>
	<rule>Spaces-only are strongly recommended over tabs.</rule>
	
	<subcategory>Maximum Line Length</subcategory>
	<rule>Limit all lines to a maximum of 79 characters.</rule>
	<rule>
		For flowing long blocks of text (docstrings or comments), limiting the 
length to 72 characters is recommended.
	</rule>
	<rule>
		The preferred way of wrapping long lines is by using Python's implied 
line continuation inside parentheses, brackets and braces. If necessary, 
you can add an extra pair of parentheses around an expression, but 
sometimes using a backslash looks better.
	</rule>

My question is, how do I have text within an element like <category>, 
which should actually be the entire parent node of the file? Am I not 
supposed to have text in it? What would be the proper way to do this?

I am thinking of something like this:

<h1>Code Layout</h1>
   <h2>Indentation</h2>
     <p>Use 4 spaces per indentation level.</p>

But obviously that isn't the structure of XML, yet I'm after something 
like that. I thought XML might be more general, and therefore a little 
more flexible to use in a variety of ways, than HTML, but I can't get 
the HTML structure out of my head when trying to write the XML file.

Thanks for any help.


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent