File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using numeric tags on XML?

 
bob connolly
Ranch Hand
Posts: 204
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 204
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic