[Catgen-developer] Re: stories
Status: Beta
Brought to you by:
mbeneteau
|
From: Marc B. <mbe...@ho...> - 2000-09-06 13:44:25
|
Do whatever you think best and most expedient. Like I said to Eugene, I
need both of you for other tasks once this is finished. We can always
re-visit afterwards if necessary. The main thing is that it work from both
"preview" and stories.jsp.
> Hello, Mark.
>
> I need an advice.
> 1) NanoXML classes build full document tree but we need more simple
thing -
> make some actions/substitutions. This document tree can be used for our
> purposes but
> 2) NanoXML work fine with XML documents, but we have mixture of HTML and
> XML. I'm not sure, but i suppose that it will be hard to explain to
NanoXML
> that some tags have start-tag but can haven't end-tag. Like <P>, end-tag
> </P> is not required.
>
> So ,
> 1) may be better to use XML based language but build custom parser without
> using NanoXML. I have small experience with YACCW - YACC clone that can
> produce high quality parser generator on Java. The result of it's work is
> two classes - parser.java (parser itself) and parserval.java(very small
> utility class) and no additional libraries. I can add lexical analyser to
it
> for optimisation.
> 2) Or modify NanoXML classes for our purpose - skip untouched HTML-part,
> parse XML-part of input and make appropriate actions/substitutions.
> 3) Use NanoXML but make some sort of filter that skip untouched HTML-part
> of input and gives the rest to NanoXML. after this i can analyse XML trees
> and make actions/substitutions.
> 4) may be exist another good ways?
> 5) ...
>
> After you make decision, I will start.
>
> ----- Original Message -----
> From: Marc Beneteau <mbe...@ho...>
> To: Marc Beneteau <ma...@od...>; Alexey Cholokov
<jt...@nv...>
> Cc: Vasian <vp...@ya...>; <ew...@al...>;
> <be...@re...>
> Sent: Wednesday, September 06, 2000 3:19 PM
> Subject: Re: stories
>
> > What is easiest for you to program, the XML syntax or the {story }
syntax?
> > We can always add the XML syntax later (it is possible to support both).
>
> I don't know. I think that with YACCW i can implement it both fast.
{story}
> syntax for beginning.
>
> > Can we use:
> > <cat:productimagesmall ../>
> > for an inline image and
> > <cat:productimagesmall>click here</cat:productimagesmall>
> > For a link, in order to minimize learning of new syntax elements? Also,
> can
>
> Certainly.
>
> > we remove case-sensitivity (this is a bit of a pain with xml in my
> opinion).
>
> Yes, i use different cases only for readability.
>
> > I am sure it is not too difficult to make an invisible applet that will
> > communicate with javascript "preview" button. I have some information
on
> > this here, if you need, I would just have to search for it. Then we can
> use
> > nanoXML without too much difficulty, I would think.
>
> Great idea! I can write this applet, but some information can be useful
too.
>
>
>
> > ----- Original Message -----
> > From: "Alexey Cholokov" <jt...@nv...>
> > To: "Marc Beneteau" <ma...@od...>
> > Cc: <be...@re...>; <ew...@al...>
> > Sent: Wednesday, September 06, 2000 5:40 AM
> > Subject: Re: stories
> >
> >
> > > Hello, Mark, Vasian, Eugene.
> > >
> > > Using XML constructions inside HTML tags - is it important?
> > > I think that we can't use some constructions like in your example if
we
> > will
> > > use standard XML parser.
> > > For example: for element "A" we can imagine following construction:
> > > <A href="<productimage imagekey='50' align='left'/>"> Alternate text
> </A>
> > > I think that it is invalid construction for XML. Because we have
> attribute
> > > value that is XML Element itself.
> > >
> > > But we can use something like this (first variant):
> > > "<cat:productImageRef TPCode="20" ImageKey=50 align="left"
> > > alternate="Alternate text" />" and replace it after processing to
> > > "<div align="center"><A
> href="\servlet\showProduct?TPCode=20&ImageKey=50">
> > > Alternate text </A></div>"
> > >
> > > Or we can write preprocessor that parse only elements that it know
(for
> > > example prefixed with "cat:") and use something like this (second
> > variant):
> > > "<p>Click <a href=<cat:productimagesmall productCode="22"/>>here</a>
for
> a
> > > small photo of our china bear."
> > >
> > > first variant:
> > > + can be processed by standard XML parser (it can be useful if you
plan
> > > story stories in XML, not HTML).
> > > both variant:
> > > - longer descriptions in comparsion with your idea.
> > >
> > > So, XML-like syntax can be:
> > > <p>Here is a large photo of our china bear: <cat:productimage
> > > productCode="22" height="150" width="150" align="right" type="large"/>
> > > <p>Click <cat:productimage productCode="22" height="150" width="150"
> > > type="small"/>here</a> for a small photo of our china bear.
> > > <p>My grandmother: <cat:image ImageKey="22" height="150" width="150"
> > > align="right"/>
> > > <p>Read more about my grandmother <cat:story
> StoryKey="4">here</cat:story>
> > > <p>See our <cat:company> company home page</cat:company>
> > > <p>All our china bears are made by <cat:producer producerKey="5">My
> slave
> > > #5</cat:producer>
> > > <p>See the <cat:link href="xyz">home page of my slave's labor
> > > union</cat:link>
> > >
> > > Some unclear about "It also has to work from both javascript and jsp".
> Is
> > it
> > > mean that stories must be fetched and formatted if they called from
> > > javascript and jsp?
> > >
> > > ----- Original Message -----
> > > From: Marc Beneteau <mbe...@ho...>
> > > To: Alexey Cholokov <jt...@nv...>; Marc Beneteau
> > <ma...@od...>
> > > Cc: Eugene Bortsov <be...@re...>; Vasian
> > > <ew...@al...>
> > > Sent: Wednesday, September 06, 2000 1:14 AM
> > > Subject: Re: stories
> > >
> > >
> > > > Make it happen. The syntax I am proposing is easier than xml but
xml
> > > would
> > > > give us more features in future and also be more standard. Send a
> > > proposal
> > > > and we will vote on it. Whatever syntax we choose has to work from
> > within
> > > <a
> > > > > tags. It also has to work from both javascript and jsp.
> > > >
> > > > Marc.
> > > >
> > > > ----- Original Message -----
> > > > From: "Alexey Cholokov" <jt...@nv...>
> > > > To: "Marc Beneteau" <ma...@od...>
> > > > Cc: "Eugene Bortsov" <be...@re...>; "Vasian"
> > > > <ew...@al...>
> > > > Sent: Tuesday, September 05, 2000 5:59 PM
> > > > Subject: Re: stories
> > > >
> > > >
> > > > > Hello, Mark
> > > > >
> > > > > ----- Original Message -----
> > > > > From: Marc Beneteau
> > > > > To: Vasian
> > > > > Cc: Alexey Cholokov
> > > > > Sent: Tuesday, September 05, 2000 4:30 PM
> > > > > Subject: stories
> > > > >
> > > > >
> > > > > > Vasian, Eugene,
> > > > >
> > > > > > Please give some thought to this design question and let me
know.
> > > > >
> > > > > > I want to allow access within a story to any database entity -
> > image,
> > > > > company, productimage, producer, even another story. I was
thinking
> > of
> > > > > something like:
> > > > >
> > > > > > <p>Here is a large photo of our china bear: {productimagelarge
22
> > > > > height=150 width=150 align=right}
> > > > > > <p>Click <a href={productimagesmall 22}>here</a> for a small
photo
> > of
> > > > our
> > > > > china bear.
> > > > > > <p>My grandmother: {image 23 align=right}
> > > > > > <p>Read more about my grandmother <a href={story 4}>here</a>
> > > > > > <p>See our <a href={company}>company home page</a>
> > > > > > <p>All our china bears are made by <a href={producer 5}>My
slave
> > > #5</a>
> > > > > > <p>See the <a href={company xyz}>home page of my slave's labor
> > > union</a>
> > > > >
> > > > > > At first I thought some xml type language would be nice, but
then
> > can
> > > we
> > > > > make xml work within html anchor tags?
> > > > >
> > > > > Why not? You can modify some lightweight parser like NanoXML for
> this
> > > > > purpose. This project (NanoXML) is on SourceForge too.
> > > > > Or you can use some tool that use regular expressions (RegExp or
> > > something
> > > > > like this). I think that they can be easy for use in this case.
> > > > >
> > > > > > Also the question to be decided of what goes into database - is
it
> > > > > "untranslated text" or the translated version? I think
untranslated
> > > text
> > > > is
> > > > > better (which then need a pre-processor servlet such
> > > > > /servlet/Story?StoryKey=22&TPCode=xyx) or is it such as it is now,
> > where
> > > > > database StoryContent contains translated text which then needs to
> be
> > > > > untranslated when modifying a story? I am also thinking that the
> > TPCode
> > > > > needs to be made accessible to javascript because all database
> entity
> > > > links
> > > > > require a TPCode.
> > > > >
> > > > > Untranstated text is better. Because reverse translation is,
> > generally,
> > > > more
> > > > > complex thing then forward translation..
> > > > >
> > > > > > Will it work?
> > > > >
> > > > > > Marc.
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>
>
>
|