RE: Publishing custom XML content

"Benno Luthiger" <[email protected]>
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <000801c47ebd$89872270$1e238481@openlu>
Dear Yuri

The fact that you have a DTD proves that you could perform the same way as I did with my EP Silva extension. Because you have a DTD you know which elements can appear and, therefore, which elements you have to define when creating the adapted widgets editor. The widgets editor is something like a transformer telling the elements how they can render themselves.

The order of appearance of the elements doesn't matter at all, neither does the internal structure. The Silva views system just scans through the document and every time it encounters an element, it looks up the widgets editor to find out, how the element is rendered.

The fact that you don't create and edit your custom contents makes things easier. You can restrict yourself to the view part and can skip the add/edit part. However, you have to define quite a lot of widgets. Therefore, the question is whether you could do it in another and easier way. As far as I see it you need something like an XSLT transformation. But XSLT is not yet part of the Silva view system.

Nevertheless, defining your own content types by extending Silva should work, even for documents compliant to your DTD.

Regards,
Benno


> -----Original Message-----
> From: Yuri Smetsers [mailto:[email protected]]
> Sent: Dienstag, 10. August 2004 10:39
> To: [email protected]
> Cc: silva-dev-IAPFreCvJWM6s/[email protected]
> Subject: Re: [silva-dev] Publishing custom XML content
> 
> 
> Hi Benno,
> 
>  > If that means to create your own Silva content type, you might be 
> interested in the Extending Silva HowTo I updated to this year's 
> EuroPython conference.
> I downloaded, installed and studied it, but I haven't figured out if 
> whether useful for our purposes or not.
> For example, our XML-structure is never the same, while your 
> XML always 
> uses the same elements at the same place.
> 
> Your XML:
> 
>     <eptalk>
>       <eptspeaker>Benno Luthiger</eptspeaker>
>       <epttitle>Extending Silva</epttitle>
>       <eptabstract>Silva has plugin capability built in. This 
> feature ...</eptabstract>
>       <eptaudience>technical, advanced</eptaudience>
>       <epttype>normal talk</epttype>
>       <eptduration>60 Minutes</eptduration>
>       <eptbio>The speaker has been ...</eptbio>
>     </eptalk>
> 
> Our XML:
> 
> <BOEK>
> <METAINFO/>
> <ONDERDEEL>
> <TITEL>Werken in het primair onderwijs</TITEL>
> <OPENINGSFIGUUR><AFBEELDING 
> BRON="Basisonderwijs316.tif"/></OPENINGSFIGUUR>
> <INLEIDING>
> <KOP NUMMER="1">Inleiding en verantwoording</KOP>
> <INTRO>
> <ALINEA>
> <SUBALINEA>[some text]</SUBALINEA>
> <SUBALINEA>[some text]</SUBALINEA>
> </ALINEA>
> </INTRO>
> <ALINEA>
> <SUBALINEA>[even more text]</SUBALINEA>
> </ALINEA>
> <ALINEA>
> <SUBALINEA>
> <OPSOMMING TYPE="NUMMER">
> <ITEM>
> <OPSOMALINEA>
> <OPSOMSUBALINEA>
> <VET>Onderwijsassistent in het primair onderwijs</VET>
> </OPSOMSUBALINEA>
> <OPSOMSUBALINEA>[text]</OPSOMSUBALINEA>
> </OPSOMALINEA>
> </ITEM>
> 
> ... and so on ... quite a disaster. ;)
> 
> </BOEK>
> 
> Also, our documents will have to be imported into Silva, instead of 
> being created (and/or edited).
> 
> Do you think this is still possible using your content type, or will 
> things get too complicated?
> 
> Regards,
> Yuri Smetsers
> 
> PS: I included the DTD we're using, in case you're interested. :)
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.