?
Solved

Create Htmls

Posted on 2007-07-26
5
Medium Priority
?
334 Views
Last Modified: 2013-11-18
Hello Experts,

I have an input xml file...and need to create html's files based on this xml...
the structure of input xml file is below...and the output required is something like in table structure...so the as per given input there will be two html files one with name Button.html and other one with TextArea.html in folder like out/mx/controls/Button.html and out/mx/controls/TextArea.html...

Here mx/controls/ are taken from apiClassifier/@id.....

So the final output for Button.html is like.....

Output...Button.html
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td>
<td>
<a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">mx.controls</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td>
<td class="classSignature">public  class  Button<a href="../../mx/core/IDataRenderer.html">IDataRenderer</a>, <a href="../../mx/controls/listClasses/IDropInListItemRenderer.html">IDropInListItemRenderer</a>, <a href="../../mx/managers/IFocusManagerComponent.html">IFocusManagerComponent</a>, <a href="../../mx/controls/listClasses/IListItemRenderer.html">IListItemRenderer</a>, <a href="../../mx/core/IFontContextComponent.html">IFontContextComponent</a>, <a href="../../flash/events/IEventDispatcher.html">IEventDispatcher</a>, <a href="../../mx/core/IFlexDisplayObject.html">IFlexDisplayObject</a>, <a href="../../mx/managers/ILayoutManagerClient.html">ILayoutManagerClient</a>, <a href="../../mx/styles/ISimpleStyleClient.html">ISimpleStyleClient</a>, <a href="../../mx/core/IUIComponent.html">IUIComponent</a>, <a href="../../flash/display/IBitmapDrawable.html">IBitmapDrawable</a>
</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td>
<td class="inheritanceList">Button  <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> <a href="../../mx/core/UIComponent.html">UIComponent</a> <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> <a href="../../mx/core/FlexSprite.html">FlexSprite</a> <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> <a href="../../flash/display/Sprite.html">Sprite</a> <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> <a href="../../flash/display/DisplayObjectContainer.html">DisplayObjectContainer</a> <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> <a href="../../flash/display/InteractiveObject.html">InteractiveObject</a> <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> <a href="../../flash/display/DisplayObject.html">DisplayObject</a> <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> <a href="../../flash/events/EventDispatcher.html">EventDispatcher</a> <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../images/inherit-arrow.gif"> <a href="../../Object.html">Object</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Implements</td>
<td><a href="../../mx/core/IDataRenderer.html">IDataRenderer</a>, <a href="../../mx/controls/listClasses/IDropInListItemRenderer.html">IDropInListItemRenderer</a>, <a href="../../mx/managers/IFocusManagerComponent.html">IFocusManagerComponent</a>, <a href="../../mx/controls/listClasses/IListItemRenderer.html">IListItemRenderer</a>, <a href="../../mx/core/IFontContextComponent.html">IFontContextComponent</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Subclasses</td>
<td><a href="../../mx/containers/accordionClasses/AccordionHeader.html">AccordionHeader</a>, <a href="../../mx/controls/CheckBox.html">CheckBox</a>, <a href="../../mx/controls/LinkButton.html">LinkButton</a>, <a href="../../mx/controls/PopUpButton.html">PopUpButton</a>, <a href="../../mx/controls/RadioButton.html">RadioButton</a>, <a href="../../mx/controls/scrollClasses/ScrollThumb.html">ScrollThumb</a>, <a href="../../mx/controls/sliderClasses/SliderThumb.html">SliderThumb</a></td>
</tr>
</table>

Input.xml
<package id="mx.controls">
<apiClassifier id="mx.controls:Button">
         <apiName>Button</apiName>
         <apiClassifierDef>
            <BaseInterface>
               <apiClassifier id="mx.core:IDataRenderer"/>
               <apiClassifier id="mx.controls.listClasses:IDropInListItemRenderer"/>
               <apiClassifier id="mx.managers:IFocusManagerComponent"/>
               <apiClassifier id="mx.controls.listClasses:IListItemRenderer"/>
               <apiClassifier id="mx.core:IFontContextComponent"/>
               <apiClassifier id="flash.events:IEventDispatcher"/>
               <apiClassifier id="mx.core:IFlexDisplayObject"/>
               <apiClassifier id="mx.managers:ILayoutManagerClient"/>
               <apiClassifier id="mx.styles:ISimpleStyleClient"/>
               <apiClassifier id="mx.core:IUIComponent"/>
               <apiClassifier id="flash.display:IBitmapDrawable"/>
            </BaseInterface>
            <Inheritance>
               <BaseClass>mx.core:UIComponent</BaseClass>
               <BaseClass>mx.core:FlexSprite</BaseClass>
               <BaseClass>flash.display:Sprite</BaseClass>
               <BaseClass>flash.display:DisplayObjectContainer</BaseClass>
               <BaseClass>flash.display:InteractiveObject</BaseClass>
               <BaseClass>flash.display:DisplayObject</BaseClass>
               <BaseClass>flash.events:EventDispatcher</BaseClass>
               <BaseClass>Object</BaseClass>
            </Inheritance>
            <Impliments>
               <apiClassifier id="mx.core:IDataRenderer"/>
               <apiClassifier id="mx.controls.listClasses:IDropInListItemRenderer"/>
               <apiClassifier id="mx.managers:IFocusManagerComponent"/>
               <apiClassifier id="mx.controls.listClasses:IListItemRenderer"/>
               <apiClassifier id="mx.core:IFontContextComponent"/>
            </Impliments>
            <Subclasses>
               <apiClassifier id="mx.containers.accordionClasses:AccordionHeader"/>
               <apiClassifier id="mx.controls.scrollClasses:ScrollThumb"/>
               <apiClassifier id="mx.controls.sliderClasses:SliderThumb"/>
               <apiClassifier id="mx.controls:PopUpButton"/>
               <apiClassifier id="mx.controls:RadioButton"/>
               <apiClassifier id="mx.controls:CheckBox"/>
               <apiClassifier id="mx.controls:LinkButton"/>
            </Subclasses>
         </apiClassifierDef>
      </apiClassifier>

      <apiClassifier id="mx.controls:TextArea">
         <apiName >TextArea</apiName>
         <apiClassifierDef>
            <BaseInterface>
               <apiClassifier id="mx.core:IDataRenderer"/>
               <apiClassifier id="mx.controls.listClasses:IDropInListItemRenderer"/>
               <apiClassifier id="mx.managers:IFocusManagerComponent"/>
               <apiClassifier id="mx.core:IIMESupport"/>
               <apiClassifier id="mx.controls.listClasses:IListItemRenderer"/>
               <apiClassifier id="mx.core:IFontContextComponent"/>
               <apiClassifier id="flash.events:IEventDispatcher"/>
               <apiClassifier id="mx.core:IFlexDisplayObject"/>
               <apiClassifier id="mx.managers:ILayoutManagerClient"/>
               <apiClassifier id="mx.styles:ISimpleStyleClient"/>
               <apiClassifier id="mx.core:IUIComponent"/>
               <apiClassifier id="flash.display:IBitmapDrawable"/>
            </BaseInterface>
            <Inheritance>
               <BaseClass>mx.core:ScrollControlBase</BaseClass>
               <BaseClass>mx.core:UIComponent</BaseClass>
               <BaseClass>mx.core:FlexSprite</BaseClass>
               <BaseClass>flash.display:Sprite</BaseClass>
               <BaseClass>flash.display:DisplayObjectContainer</BaseClass>
               <BaseClass>flash.display:InteractiveObject</BaseClass>
               <BaseClass>flash.display:DisplayObject</BaseClass>
               <BaseClass>flash.events:EventDispatcher</BaseClass>
               <BaseClass>Object</BaseClass>
            </Inheritance>
            <Impliments>
               <apiClassifier id="mx.core:IDataRenderer"/>
               <apiClassifier id="mx.controls.listClasses:IDropInListItemRenderer"/>
               <apiClassifier id="mx.managers:IFocusManagerComponent"/>
               <apiClassifier id="mx.core:IIMESupport"/>
               <apiClassifier id="mx.controls.listClasses:IListItemRenderer"/>
               <apiClassifier id="mx.core:IFontContextComponent"/>
            </Impliments>
            <Subclasses/>
         </apiClassifierDef>
      </apiClassifier>
</package>



Can you pls help to create xslt code for the same....?

Thanks,
Shailesh
0
Comment
Question by:ShaileshShinde
  • 2
  • 2
5 Comments
 
LVL 13

Expert Comment

by:R7AF
ID: 19575961
If I take the following XML:

<test>
      <apiClassifier id="mx.controls.listClasses:IDropInListItemRenderer"/>
</test>

the following xslt will basically do what you need:

<xsl:template match="test">
      <p>Filepath: <xsl:value-of select="translate(substring-before(apiClassifier/@id,':'),'.','/')" /></p>
      <p>File: <xsl:value-of select="substring-after(apiClassifier/@id,':')" /></p>
</xsl:template>
0
 
LVL 1

Author Comment

by:ShaileshShinde
ID: 19580404
Hello Experts,

I have to write html's using redirect:write...how to do this in xsl?

Thanks,
Shailesh
0
 
LVL 13

Expert Comment

by:R7AF
ID: 19580860
Hello ShaileshShinde

I have given a response to your original question. If you have another question, then I suggest you post another question.

Thanks!
0
 
LVL 1

Author Comment

by:ShaileshShinde
ID: 19582004
Hello Expert,

This is related to same question as need to create html's not html.....
So using redirect:write how it is done?

Thanks,
Shailesh
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 1500 total points
ID: 19590858
> This is related to same question as need to create html's not html.....

this was indeed in the original question

there are several options for writing multiple HTML files from one XML
Maybe the simplest to implement if you need to redirect streams is having multiple XSLT files
and call two xslt processes each with a different output stream

If you are using saxon you can use <saxon:output file="...">...
If you are using xalan, you can use <xalan:write select="...">...

or use xslt2.0 where such functionality is standardised

cheers

Geert
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
The viewer will learn how to count occurrences of each item in an array.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question