You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jarry Liu <ja...@gmail.com> on 2005/07/26 18:55:11 UTC

Re: Dynamic SVG bar graph

Hi, 
I am very interested with this topic. Can you give me more information
about this SVG and Fragment Extractor?
I use JEuclid to tansform MathML and present it with SVG. But in the
output, I want add other html stuff in it. How can I do it?
Here is part of the code I used:

<map:generate src="temp1.mml"/>
<map:transform type="mml2svg"/>         
<map:serialize type="svgxml"/>

Thanks.

Jarry


On 4/29/05, Dustin N. Jenkins <dj...@invoqsystems.com> wrote:
> In case anyone is interested, I found the Fragment Extractor
> Generator/Transformer to work just fine for what I needed.
> 
> Currently, the default namespace is "http://www.w3.org/2000/svg", so
> below, where I have the <svg> tag, I can just specify
>                <svg xmlns="http://www.w3.org/2000/svg">
>                   <!-- BUILD DYNAMIC XML TO REPRESENT SVG -->
>                </svg>
> 
> and specify in my sitemap the src for the generator within my SVG
> pipeline.  Works great.
> 
> - Dustin
> 
> 
> 
> Dustin N. Jenkins wrote:
> 
> > Hello and thanks for reading this.
> >
> > I'd like to create a dynamically generated SVG bar graph for a
> > scheduling system.  The resulting table will display the weekdays
> > along the top, and bars beneath them indicating for what days of the
> > week a schedule will cover.  I've been painstakingly doing it with
> > HTML tables as it seems like for Cocoon to do it, it needs to pass
> > through a pipeline.  I noticed that there is an
> > xmlns:svg="http://www.w3.org/2000/svg" in an example that requires a
> > client side plugin.  This will also be inside a form, but that
> > shouldn't matter.  Kind of like the following:
> >
> > XML:
> > <page...>
> >    <form-template...>
> >      <list-table>
> >        <header>S</header>
> >        <header>M</header>
> >        <header>T</header>
> >        <header>W</header>
> >        <header>Th</header>
> >        <header>F</header>
> >        <header>Sa</header>
> >         <c:forEach select="#{scheduleList}">
> >             <schedule>
> >                <svg>
> >                   <!-- BUILD DYNAMIC XML TO REPRESENT SVG -->
> >                </svg>
> >             </schedule>
> >         </c:forEach>
> >      </list-table>
> >    </form-template>
> > </page>
> >
> > XSL:
> > <xsl:template match="svg">
> >    <!-- Do the SVG STUFF whatever that may be. -->
> > </xsl:template>
> >
> >
> > Has anyone done something similar to this with SVG and Cocoon?
> >
> > Many thanks!
> > Dustin
> >
> 
> --
> Dustin N. Jenkins
> Application Developer
> Invoq Systems
> 216 - 852 Fort St.
> Victoria, British Columbia
> 250.383.0311
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic SVG bar graph

Posted by Jarry Liu <ja...@gmail.com>.
Hi, Benni

Thanks for your kindness.
Now I can get SVG from MathML and can output it with "svgxml"
serialize. What I want to do is show this SVG with some html stuff in
the same output. Do you have any suggestions? If you can share your
code, that will be great!

Jarry





On 7/26/05, Benjamin Boksa <be...@boksa.de> wrote:
> Hi!
> 
> we have worked on the subject of generating diagrams from XML in a
> university project, but I don't think the stuff is mature enough to
> be published here.
> 
> We used the following approach:
> 
> Define a very general language to represents the diagrams (we called
> it DML) and use XSLT to generate SVGs from that language. If this is
> interesting for you I might get the permission to share the stuff
> with you.
> 
> Regards,
> 
> Benni
> 
> 
> 
> Am 26.07.2005 um 18:55 schrieb Jarry Liu:
> 
> > Hi,
> > I am very interested with this topic. Can you give me more information
> > about this SVG and Fragment Extractor?
> > I use JEuclid to tansform MathML and present it with SVG. But in the
> > output, I want add other html stuff in it. How can I do it?
> > Here is part of the code I used:
> >
> > <map:generate src="temp1.mml"/>
> > <map:transform type="mml2svg"/>
> > <map:serialize type="svgxml"/>
> >
> > Thanks.
> >
> > Jarry
> >
> >
> > On 4/29/05, Dustin N. Jenkins <dj...@invoqsystems.com> wrote:
> >
> >> In case anyone is interested, I found the Fragment Extractor
> >> Generator/Transformer to work just fine for what I needed.
> >>
> >> Currently, the default namespace is "http://www.w3.org/2000/svg", so
> >> below, where I have the <svg> tag, I can just specify
> >>                <svg xmlns="http://www.w3.org/2000/svg">
> >>                   <!-- BUILD DYNAMIC XML TO REPRESENT SVG -->
> >>                </svg>
> >>
> >> and specify in my sitemap the src for the generator within my SVG
> >> pipeline.  Works great.
> >>
> >> - Dustin
> >>
> >>
> >>
> >> Dustin N. Jenkins wrote:
> >>
> >>
> >>> Hello and thanks for reading this.
> >>>
> >>> I'd like to create a dynamically generated SVG bar graph for a
> >>> scheduling system.  The resulting table will display the weekdays
> >>> along the top, and bars beneath them indicating for what days of the
> >>> week a schedule will cover.  I've been painstakingly doing it with
> >>> HTML tables as it seems like for Cocoon to do it, it needs to pass
> >>> through a pipeline.  I noticed that there is an
> >>> xmlns:svg="http://www.w3.org/2000/svg" in an example that requires a
> >>> client side plugin.  This will also be inside a form, but that
> >>> shouldn't matter.  Kind of like the following:
> >>>
> >>> XML:
> >>> <page...>
> >>>    <form-template...>
> >>>      <list-table>
> >>>        <header>S</header>
> >>>        <header>M</header>
> >>>        <header>T</header>
> >>>        <header>W</header>
> >>>        <header>Th</header>
> >>>        <header>F</header>
> >>>        <header>Sa</header>
> >>>         <c:forEach select="#{scheduleList}">
> >>>             <schedule>
> >>>                <svg>
> >>>                   <!-- BUILD DYNAMIC XML TO REPRESENT SVG -->
> >>>                </svg>
> >>>             </schedule>
> >>>         </c:forEach>
> >>>      </list-table>
> >>>    </form-template>
> >>> </page>
> >>>
> >>> XSL:
> >>> <xsl:template match="svg">
> >>>    <!-- Do the SVG STUFF whatever that may be. -->
> >>> </xsl:template>
> >>>
> >>>
> >>> Has anyone done something similar to this with SVG and Cocoon?
> >>>
> >>> Many thanks!
> >>> Dustin
> >>>
> >>>
> >>
> >> --
> >> Dustin N. Jenkins
> >> Application Developer
> >> Invoq Systems
> >> 216 - 852 Fort St.
> >> Victoria, British Columbia
> >> 250.383.0311
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >> For additional commands, e-mail: users-help@cocoon.apache.org
> >>
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
> >
> 
> 
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic SVG bar graph

Posted by Benjamin Boksa <be...@boksa.de>.
Hi!

we have worked on the subject of generating diagrams from XML in a  
university project, but I don't think the stuff is mature enough to  
be published here.

We used the following approach:

Define a very general language to represents the diagrams (we called  
it DML) and use XSLT to generate SVGs from that language. If this is  
interesting for you I might get the permission to share the stuff  
with you.

Regards,

Benni



Am 26.07.2005 um 18:55 schrieb Jarry Liu:

> Hi,
> I am very interested with this topic. Can you give me more information
> about this SVG and Fragment Extractor?
> I use JEuclid to tansform MathML and present it with SVG. But in the
> output, I want add other html stuff in it. How can I do it?
> Here is part of the code I used:
>
> <map:generate src="temp1.mml"/>
> <map:transform type="mml2svg"/>
> <map:serialize type="svgxml"/>
>
> Thanks.
>
> Jarry
>
>
> On 4/29/05, Dustin N. Jenkins <dj...@invoqsystems.com> wrote:
>
>> In case anyone is interested, I found the Fragment Extractor
>> Generator/Transformer to work just fine for what I needed.
>>
>> Currently, the default namespace is "http://www.w3.org/2000/svg", so
>> below, where I have the <svg> tag, I can just specify
>>                <svg xmlns="http://www.w3.org/2000/svg">
>>                   <!-- BUILD DYNAMIC XML TO REPRESENT SVG -->
>>                </svg>
>>
>> and specify in my sitemap the src for the generator within my SVG
>> pipeline.  Works great.
>>
>> - Dustin
>>
>>
>>
>> Dustin N. Jenkins wrote:
>>
>>
>>> Hello and thanks for reading this.
>>>
>>> I'd like to create a dynamically generated SVG bar graph for a
>>> scheduling system.  The resulting table will display the weekdays
>>> along the top, and bars beneath them indicating for what days of the
>>> week a schedule will cover.  I've been painstakingly doing it with
>>> HTML tables as it seems like for Cocoon to do it, it needs to pass
>>> through a pipeline.  I noticed that there is an
>>> xmlns:svg="http://www.w3.org/2000/svg" in an example that requires a
>>> client side plugin.  This will also be inside a form, but that
>>> shouldn't matter.  Kind of like the following:
>>>
>>> XML:
>>> <page...>
>>>    <form-template...>
>>>      <list-table>
>>>        <header>S</header>
>>>        <header>M</header>
>>>        <header>T</header>
>>>        <header>W</header>
>>>        <header>Th</header>
>>>        <header>F</header>
>>>        <header>Sa</header>
>>>         <c:forEach select="#{scheduleList}">
>>>             <schedule>
>>>                <svg>
>>>                   <!-- BUILD DYNAMIC XML TO REPRESENT SVG -->
>>>                </svg>
>>>             </schedule>
>>>         </c:forEach>
>>>      </list-table>
>>>    </form-template>
>>> </page>
>>>
>>> XSL:
>>> <xsl:template match="svg">
>>>    <!-- Do the SVG STUFF whatever that may be. -->
>>> </xsl:template>
>>>
>>>
>>> Has anyone done something similar to this with SVG and Cocoon?
>>>
>>> Many thanks!
>>> Dustin
>>>
>>>
>>
>> --
>> Dustin N. Jenkins
>> Application Developer
>> Invoq Systems
>> 216 - 852 Fort St.
>> Victoria, British Columbia
>> 250.383.0311
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


Re: Dynamic SVG bar graph

Posted by Jarry Liu <ja...@gmail.com>.
Joerg,
Thanks again for you help.
I am using Mac OS X and Safari as the browser, so it may be the reason
why I can't get htm + svg together. I will try other browers later.

Jarry

>  From what I see FragmentExtractor* is really the wrong for you. But
> there is nothing special about the svgxml serializer, it's only a
> special xml serializer with doctype set correctly.
> 
> If you can view HTML with embedded SVG I guess you have a newer browser
> or a special viewer that probably understands XHTML too. At the end this
> means serializing the complete XML (HTML + embedded SVG) with the XHTML
> serializer should work.
> 
> Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic SVG bar graph

Posted by Joerg Heinicke <jo...@gmx.de>.
On 26.07.2005 19:50, Jarry Liu wrote:

> Yes, I can also add some html stuff in svg file to reach my goal. What
> I mostly concern is how I can output html and svg in the same page. Is
> there any other serializer I can use to show svg except "svgxml"?

 From what I see FragmentExtractor* is really the wrong for you. But 
there is nothing special about the svgxml serializer, it's only a 
special xml serializer with doctype set correctly.

If you can view HTML with embedded SVG I guess you have a newer browser 
or a special viewer that probably understands XHTML too. At the end this 
means serializing the complete XML (HTML + embedded SVG) with the XHTML 
serializer should work.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic SVG bar graph

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jul 26, 2005, at 10:50 AM, Jarry Liu wrote:

> Yes, I can also add some html stuff in svg file to reach my goal. What
> I mostly concern is how I can output html and svg in the same page. Is
> there any other serializer I can use to show svg except "svgxml"?

Stepping back a little... :-)  Have you looked at Fins?

http://cocoondev.org/main/117/29.html

best,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic SVG bar graph

Posted by Jarry Liu <ja...@gmail.com>.
Joerg, 
Thanks a lot for your reply.
Yes, I can also add some html stuff in svg file to reach my goal. What
I mostly concern is how I can output html and svg in the same page. Is
there any other serializer I can use to show svg except "svgxml"?

On 7/26/05, Joerg Heinicke <jo...@gmx.de> wrote:
> On 26.07.2005 18:55, Jarry Liu wrote:
> 
> > I am very interested with this topic. Can you give me more information
> > about this SVG and Fragment Extractor?
> 
> The FragmentExtractor{Generator|Transformer} can be found in the batik
> block in 2.1.7 or in the core since a few days (as it is not really tied
> to batik, the usecase Dustin had is just an example - and it also was
> the initial usecase and the reason it was moved to batik block). It
> extracts specific elements in a specific namespace from the original XML
> in the pipeline, stores them temporarily and puts some links instead of
> it into the original XML. These links request the temporarily stored
> snippets and you can do with them whatever you want, e.g. converting
> them to images as in Dustin's usecase.
> 
> > I use JEuclid to tansform MathML and present it with SVG. But in the
> > output, I want add other html stuff in it. How can I do it?
> > Here is part of the code I used:
> >
> > <map:generate src="temp1.mml"/>
> > <map:transform type="mml2svg"/>
> > <map:serialize type="svgxml"/>
> 
> Now I don't know if the FragmentExtractor* stuff is appropriate for your
> use case. Don't you want to add something instead of extracting?
> 
> Joerg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Dynamic SVG bar graph

Posted by Joerg Heinicke <jo...@gmx.de>.
On 26.07.2005 18:55, Jarry Liu wrote:

> I am very interested with this topic. Can you give me more information
> about this SVG and Fragment Extractor?

The FragmentExtractor{Generator|Transformer} can be found in the batik 
block in 2.1.7 or in the core since a few days (as it is not really tied 
to batik, the usecase Dustin had is just an example - and it also was 
the initial usecase and the reason it was moved to batik block). It 
extracts specific elements in a specific namespace from the original XML 
in the pipeline, stores them temporarily and puts some links instead of 
it into the original XML. These links request the temporarily stored 
snippets and you can do with them whatever you want, e.g. converting 
them to images as in Dustin's usecase.

> I use JEuclid to tansform MathML and present it with SVG. But in the
> output, I want add other html stuff in it. How can I do it?
> Here is part of the code I used:
> 
> <map:generate src="temp1.mml"/>
> <map:transform type="mml2svg"/>         
> <map:serialize type="svgxml"/>

Now I don't know if the FragmentExtractor* stuff is appropriate for your 
use case. Don't you want to add something instead of extracting?

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org