 |
| 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
|
|
|
|

February 28th, 2006, 05:30 AM
|
|
Registered User
|
|
Join Date: Feb 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Superscript in XML
Hi,
I am not able to use superscript tag in xml .
Kindly, let me know how to use the same .
Thanks,
Bhavana.
|
|

February 28th, 2006, 06:42 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
I don't think you have understood XML. You can use any tags you like, for example
<superscript>2</superscript>
or
<sup>2</sup>
if you prefer.
What the tags mean is up to your application. If you want this to cause 2 to be rendered as a superscript, then you will need to convert the XML into something like XHTML or XSL-FO or SVG that is understood by your display or printing software. This transformation is usually done using XSLT.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

March 1st, 2006, 12:15 AM
|
|
Registered User
|
|
Join Date: Feb 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I just know the basics of xml...
We have tried displaying registered trademark as superscript by placing sup tag as an attribute in DTD.
But it is showing Internal Server Error.
I dont know how to convert XML to XSLT.
Please reply ASAP.
FYI: we are using weblogic server 7.04 .
|
|

March 1st, 2006, 04:39 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
1) Show us a sample of your source XML.
2) Show a sample of what output you desire.
3) Show any efforts to date.
4) If you want replies ASAP pay for professional help, if you want pro bono help you take what you get at the responders own speed.
As Michael stated XML is a representation of data with NO display properties. If you want to show a superscript in HTML, which does display to users, then you use a standard HTML sup tag around the characters.
--
Joe ( Microsoft MVP - XML)
|
|

March 1st, 2006, 05:21 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
I think you need to read some books and get an understanding of the basic concepts. I can't teach you that in replies to forum messages.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

March 2nd, 2006, 03:01 AM
|
|
Registered User
|
|
Join Date: Feb 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks for your response.
As requested, I am sending the Code
I suppose to get the Superscript as "Perks® Overview"
***************** DTD File for the same **********************
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT NavigationModel (NavigationGroup+)>
<!-- the NavigationGroup represents a subset of the site that has a unique set of global navigation.
Currenty, this is expected to be one of the following
pacificare (includes SecureHorizons)
womenshealth
corporate (includes Investor Relations, Employment, Press Releases etc)
pacificare latino
isP13n : true or false - This indicates whether the Pages displayed in a NavigationGroup are filtered based on the NavigationP13nService
defaultPageGroupName - this indicates the "home" page Group within a NavigationGroup
-->
<!ELEMENT NavigationGroup (IsP13N, PageGroup+, DefaultPageGroupName?)>
<!ATTLIST NavigationGroup
name CDATA #REQUIRED
>
<!ELEMENT IsP13N (#PCDATA)>
<!ELEMENT DefaultPageGroupName (#PCDATA)>
<!-- The PageGroup defines a collection of pages that are rendered as menu items in the pull-down menu that appears when mouse-ing over a tab in the top-nav menu
-->
<!ELEMENT PageGroup (DisplayName, DisplayOrder, IsHidden?, DefaultImageURL?, SelectedImageURL?, RolloverImageURL?, ImageWidth?, Page+, DefaultPageName?)>
<!ATTLIST PageGroup
name CDATA #REQUIRED
>
<!-- The Page represents the logical Page that is displayed when the user selects a menu item from a pull-down menu from the top-nav menu.
PortalPageName - this is the name of the underlying WLP Portal Page - this is generallly it is 1-1 with the logical Page's name.
-->
<!ELEMENT Page (PortalPageName, DisplayName, DisplayOrder, IsHidden?, RootNavigationNode)>
<!ATTLIST Page
name CDATA #REQUIRED
>
<!ELEMENT DefaultPageName (#PCDATA)>
<!-- The RootNavigationNode represents the root of tree of NavigationNodes representing the left-nav menu.
The RootNavigationNode is not rendered in the left-nav menu.
The Action associated with the RootNavigationNode is the default Action for the logical Page to which the RootNavigationNode is related
-->
<!ELEMENT RootNavigationNode (Action?, NavigationNode*)>
<!ELEMENT NavigationNode (DisplayName, DisplayOrder, IsHidden?, Action?, NavigationNode*)>
<!ATTLIST NavigationNode
name CDATA #REQUIRED
>
<!-- Action represents the webflow event that is triggered when selecting a left-nav menu item.
For example, when performing a typical content query the action will be to invoke the generic content display portlet with the link.viewArticle event.
PortletName This is the name of the target portlet to which the PortletEvent is posted.
Typical values include
contentdisplay - the content display portlet handles rendering articles and handling IFRAME based functionality
PortletEvent This is the webflow event that will be posted to the Portlet named by PortletName.
Typical values include
link.viewArticle - this is the event that is posted into the contentdisplay portlet to trigger a article content query
link.iframe - this is the event that is posted into the contentdisplay portlet to trigger an iframe
The properties associated with an action provide a means of maintaining context informaiton that can be used by the target portlet.
Each property consists of a name and a value. The legal names and the expected values are determined by the portlet implementation.
However, in the DTD we have limited the name to the values expected by the implementation of the 'contentdisplay' portlet. This will need to be
modified later as new portlets are added that make use of these properties.
The Content Display Portlet - displaying an article
_______________________________________
The generic content display portlet supports the display of content based on a content query. The content query is driven by values maintained
in the PhsSession (defined in the EBCC) and to properties associated with the navigation node.
To invoke the contentdisplay portlet to perform a content query the action should be defined as follows
<Action>
<PortletName>contentdisplay</PortletName>
<PortletEvent>link.viewArticle</PortletEvent>
<Properties>
</Properties>
</Action>
Additionally, properties should be set-up in the following way
Property Name Description
____________ _________
ContentSelector This property is the name of the Content Selector defined in the Portal EBCC that will be used by when performing a content query.
The name of the content selector is a mnemonic which follows the content meta-data that should be supplied to the query.
The mnemonics are based on all of the permutations of CUPS where C = Contentdescriptor, U = Utility, p = Product, s = Segment, e.g.
contentdescriptor value description
___________________ _________
CContentSelector contentdescriptor only
CUContentSelector contentdescriptor and utility
CUPContentSelector contentdescriptor, utility and product
CUPSContentSelector contentdescriptor, utilty, product and segment
CPContentSelector contentdescriptor and product
ContentIDContentSelector content ID using the ContentID property
etc
In addition, to this explict query parameters the Content Display portlet will also add implicit parameters based on Product, Audience and Region of the
user executing the query. These are maintained in the HTTP Session and populated either by the Gateway page or after login from SiteMinder.
There are also content selector that disregard the "PAR" values. These are specifically for non-personalized navigation groups.
CorporateContentSelector This content selector expects the content descriptor to be defined on the navigation node but hardcodes the region
to '|Corporate|'
WHSContentSelector This retrieves content for the Women's Healtth Solutions site. The content selector is driven by the content descriptor
defined on the navigation node and hardcodes segment to 'Womens Health Solutions'.
ContentDescriptor This property defines the value of the "Content Descriptor" content meta-data attribute
Product This property defines the value of the "Property" content meta-data attribute
Utility This property defines the value of the "Utility" content meta-data attribute
Segment This property defines the value of the "Segment" content meta-data attribute
ContentID This property defines the value io the "id" content meta-data which holds the Vignette content id.
ContactUsType This is used be the Contact Us portlet to discriminate between different entry points.s
QIType This property identifies the type of QI Application - Core, Women, Hospital
MatrixType This property identifies the type of Selection Matrix displayed
OrderIDCardType This property identifies the type of Order ID card.
url The URL of an external web site - used by the popup portlet and contentdisplay portlet when generating
a pop-up frame or IFRAME respectively.
URLTransformer This property is the name of a class which will transform the 'url' property. Typically, this involves replacing
tokens in the 'url' property with literal values for product, audience and region. If the URLTransformer is not
supplied the popup and contentdisplay portlets use the URL directly.
URLTransformer class names include
com.phs.internet.cp.presentation.thirdparty.Connec tureURLTransformer
com.phs.internet.cp.presentation.thirdparty.GeoAcc essURLTransformer
com.phs.internet.cp.presentation.thirdparty.MyHeal th24URLTransformer
searchType Used by capitation search portlet
DefaultContentId This property is used for the generic content search portlet .
HideMenuFooter Property to decide whether to display menu bar and footer.
subsearchType Used by reports portlet
-->
<!ELEMENT Action (PortletName, PortletEvent?, Properties?)>
<!ELEMENT Properties (Property+)>
<!ELEMENT Property (#PCDATA)>
<!ATTLIST Property
name (ContentSelector | ContentDescriptor | Utility | Product | Segment | url | ContentID | ContactUsType | QIType | OrderIDCardType | URLTransformer | searchType | eventType | MatrixType | DefaultContentId | HideMenuFooter | subSearchType) #REQUIRED
value CDATA #REQUIRED
>
<!ELEMENT PortletEvent (#PCDATA)>
<!ELEMENT PortletName (#PCDATA)>
<!ELEMENT DisplayName (#PCDATA)>
<!ELEMENT DisplayOrder (#PCDATA)>
<!ELEMENT DefaultImageURL (#PCDATA)>
<!ELEMENT SelectedImageURL (#PCDATA)>
<!ELEMENT RolloverImageURL (#PCDATA)>
<!ELEMENT ImageWidth (#PCDATA)>
<!ELEMENT IsHidden (#PCDATA)>
<!ELEMENT PortalPageName (#PCDATA)>
*********************** DTD File -End ******************************
XML File has the following Code :
<?xml version="1.0" encoding="UTF-8"?>
<PageGroup name="SpecialValues">
<Page name="SpecialValues.1">
<PortalPageName>WHSPerksContentDisplay</PortalPageName>
<DisplayName>Perks® Overview</DisplayName>
<DisplayOrder>1</DisplayOrder>
<RootNavigationNode>
<Action>
<PortletName>perkscontentdisplay</PortletName>
<PortletEvent>link.viewTeaserPage</PortletEvent>
<Properties>
<Property name="ContentSelector" value="CContentSelector"/>
<Property name="ContentDescriptor" value="Perks.Perks - Overview"/>
</Properties>
</Action>
</RootNavigationNode>
</Page>
<DefaultPageName>SpecialValues.1</DefaultPageName>
</PageGroup>
************************XML CODE END**********************
In the above XML Code, there is a field "<DisplayName>PacifiCare Perks® Overview</DisplayName>" where in we have to use the Superscript. ( to get Perks® Overview)
As you said we have used superscript tag around the charecters but it is showing "Internal server Error " in the application.
And I had project deadline I asked you to reply ASAP. Thats all.
This is the first time I have posted a query.
I really got hurt the way you both replied.
Hope you will get a solution for me.
Thanks.
|
|

March 2nd, 2006, 04:46 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
If you want to display the XML, for instance using HTML, then you need to write a transform or maybe adjust the one that is currently being used.
At the moment the DisplayName element can contain PCDATA, as evinced by:
Code:
<!ELEMENT DisplayName (#PCDATA)>
This means its contents will be treated as markup so you should be able to do:
Code:
<DisplayName>Perks<sup>®</sup> Overview</DisplayName>
If this is causing an error then I suggest you try to get hold of the XSLT used to transform the document. If you can post it here then perhaps we can see how to modify it.
I'm sorry that you were upset by some of our comments but as I said responders on these forums give of their free time and when people shout that something is urgent it tends to irritate me.
In general it helps when posting to spend a few moments compiling your question so that all the main evidence is available along with a clear description of the problem.
If you rang the world's leading expert on XML and said
Quote:
|
quote: I am not able to use superscript tag in xml .
|
what chance do you think they would have of answering your question?
Regards
--
Joe ( Microsoft MVP - XML)
|
|

March 2nd, 2006, 05:19 AM
|
|
Registered User
|
|
Join Date: Feb 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Joe,
Thanks for the fast reply.
We are not using any XSLT file seperately.
So, I think we cannot render using DTD as our application is not supporting.
Once again thanks to both of you for helping me out with your Ideas.
Regards,
Bhavana.
|
|

March 2nd, 2006, 06:09 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
|
|
You cannot render anything using a DTD. A DTD is there to help make sure the structure of your XML is correct. If the XML is rendered at a later stage, as HTML or PDF for instance, then it is being transformed, either via XSLT or some other means.
I'm no expert on the BEA WebLogic server but i'm fairly sure it uses XLST to transform the XML into a user readable form.
--
Joe ( Microsoft MVP - XML)
|
|
 |