wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes Using numeric tags on XML? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Using numeric tags on XML?" Watch "Using numeric tags on XML?" New topic
Author

Using numeric tags on XML?

bob connolly
Ranch Hand

Joined: Mar 10, 2004
Posts: 204
Has anyone created their XML data using alias tag names, ie like the following example?

01 submitting_entity_id
02 rpt_dte
03 ofheo_ledger_cde
04 pct_repurchased_scale_fctr_amt

<01>������</01>
<02>������</02>
<03>������</03>
<04>������</04>

If so, is there a way to insure that the 'legend' or text names, ie '01 submitting.....' are always attached with the XML file, in order to pass the Schema validation process?

My motivation is to reduce space requirements and from what i can tell, the data will always be processed by a computer and rarely manually, so what other reason would there be keep the 'text' tag associations?

Thanks much!
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
If I remember correctly, an element name in XML documents must begin with a letter or underscore, not a digit. Otherwise your approach should work -- although debugging might not be quite as easy as with semantically meaningful element names.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Originally posted by bob connolly:
If so, is there a way to insure that the 'legend' or text names, ie '01 submitting.....' are always attached with the XML file, in order to pass the Schema validation process?
Oops. I'm afraid this might be a little too much for XML Schema validation. You might need to implement "manual" validation in Java for this kind of a rule. I might be wrong, of course.
bob connolly
Ranch Hand

Joined: Mar 10, 2004
Posts: 204
Hi Lasse!

I quess what would be needed then, is a Schema methodology that would ENFORCE the relationship between the 'alpha numeric tag' and the 'verbose definition' of that tag! And hopefully, this would insure that the 'validation' could only occur if these relationships were hard coded in the Schema itself? In other words, when validating the XML data, the Schema would have to know that the tag is an 'alias' tag and therefore, require that that alias be 'detail or futher' defined in the Schema before the 'validation' could occur?

Does this sound like a feasible approach?, so in the debugging process, one could always consult the Schema for the meaing of the 'alias' tag?

So in other words, the 'verbose' tag is mainly for the benefit of the programmer in the debugging process then?

Thanks Lasse!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using numeric tags on XML?
 
Similar Threads
Transform text file to xml
looping inside the child elements instead of using xsl:for-each
Parsing notepad content separated by pipes
XSL transformation
How would i break this down into seperate metods?