Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2006, 01:40 PM
Authorized User
 
Join Date: Apr 2006
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default using superscript in XML

hi,
I am trying to use supersciprts in my XML document. I understand I could use <sup>any_number</sup> OR <superscript>any_number</superscript> since <sup> is an HTML tag. My question is, what is <supscript>? is it an HTML tag? why it's legal to use superscript in my XML document even though it's not defined in the DTD? and if there is a list of other (non HTML) tags that could be used in any XML file without being defind in the DTD, please let me know.

thanks,
Bill
 
Old April 7th, 2006, 03:07 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If you are only interested in having well-formed XML documents, then you can use any tags you like, and you can use them to mean anything you want.

If you are interested in having valid XML documents, then you can use any tags you like, and you can use them to mean anything you want, but you must define the permitted structures in a DTD.

You can use <sup> or <supscript> or <superscript> or <werghkcaugi>, whatever takes your fancy. The DTD can control where it's permitted to appear. But what the tag actually means is a matter of private agreement between those who create the document and those who receive it.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old April 10th, 2006, 11:03 AM
Authorized User
 
Join Date: Apr 2006
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well, what I am trying to figure out is the following:
the DTD definition for <superscript> is:
<!ELEMENT superscript (#PCDATA|b|i|bi|plain|sc|so|u|mono|big|small;)*>

There is no place in this definition that tells me <superscript> should display the letter or number as a superscript. The only thing the DTD definition is telling me that we have any of these elements with <superscript> start and end tags, which is going to be parsed.
so, where is superscript tag defined to do what it supposed to do? Is this a generic tag defined somewhere else?

thanks,
bill

 
Old April 10th, 2006, 01:54 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You're really struggling with the basic concepts. There are two different conceptual layers, and you're confusing them. XML doesn't define the meaning of individual tags. It allows you to use any tags you like, to mean anything you want. Specific XML vocabularies (such as XHTML) do define tags. They define the syntax of the tags (which elements can appear within which other elements) by means of a DTD or schema, and the define the semantics of the tags (their intended meaning, e.g. <sup> means superscript) in their narrative documentation.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old April 11th, 2006, 08:57 AM
Authorized User
 
Join Date: Apr 2006
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Mr. Kay. That makes things a lot more clear for me.
now I understand if we have an application, we could have "what the tag mean" embedded in that application ; with a set of rules telling the browser or the display interface what to display for a specific tag.
I am learning XSLT & XML as fast as I can...trying to catch up to speed with things. I really really appreciate your time to respond to me and others on this forum.


bill



 
Old May 4th, 2008, 12:48 AM
Registered User
 
Join Date: Apr 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default


I want just want to share with you the way I get may subscript and superscript inin dynamic and input text field in Flash:
<sub> & <sup> tags are not supported by Flash :( but you can
use Subscript & Superscript in dynamic and input text field in Flash:

  Download & install Subscript & Superscript fonts from http://www.subscriptfont.com or http://www.superscriptfont.com
  You will need to restart Flash software after installed fonts.
  Create a dynamic text field with Arial font embeded. Set the HTML property to true.
  Create a dynamic text field with Subscript font embeded.
  Create a dynamic text field with Superscript font embeded.
  Use HTML tag to set text to subscript or superscript like below:
  Some text©
  If you are using ActionScript to test the htmlText, use script like below:
  my_txt.htmlText = "Some textTM";
Data can come from a XML file, TEXT file or from flash itself.

They are better than CG since it goes lower than the baseline and it's real subscript..

 
Old May 4th, 2008, 02:45 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Thanks for sharing this, but you've chosen the wrong place. This has nothing at all to do with XML. It's about HTML and Flash. You can represent subscripts and superscripts in XML any way you fancy, so long as you translate them to the right thing when the XML is rendered.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.net, adding XML data to an existing XML file saikoboarder XML 11 April 17th, 2008 04:19 PM
superscript in reporting service yaseen Crystal Reports 0 March 29th, 2007 02:12 AM
Superscript Date Format r_taduri Crystal Reports 1 July 3rd, 2006 02:55 PM
Superscript in XML Bhavana.t XML 8 March 2nd, 2006 06:09 AM
SuperScript PC User Access 2 June 15th, 2004 02:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.