ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* XML filtering
@ 2006-09-03 17:36 WN
  2006-09-03 17:41 ` Hans Hagen
  0 siblings, 1 reply; 3+ messages in thread
From: WN @ 2006-09-03 17:36 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 2380 bytes --]

Hello,

I have a couple of XML's generated by a freeware program which I want to 
process with Context.
I started experimenting and things look good, however I want to 
skip/filter out some of the xml tags
like *<computeraudit> Some Text .... </computeraudit>* and *<disclaimer> 
Some Text </disclaimer>*
so they don't show in the resulting PDF.

The Tex and XML files are listed below.

\usemodule[contml]
\defineXMLargument [category] {\chapter{ \XMLpar{category}{title}{} }}
\defineXMLargument [subcategory] {\section{ \XMLpar{subcategory}{title}{} }}
\defineXMLenvironment [list] \startitemize \stopitemize
\defineXMLenvironment [item] \item \par

\defineXMLenvironment [recordset] \bTABLE \eTABLE
\defineXMLpickup [datarow] \bTR \eTR
\defineXMLpickup [fieldvalue] \bTD \eTD
\starttext
\processXMLfilegrouped{Bios.xml}
\stoptext

<?xml ============== File Bios.xml ===================>
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="wa_xml2html.xsl"?>
<computeraudit>
    <title>Computer Audit :: 03-Sep-2006 18:25:08</title>
    <category title="BIOS Version">
        <subcategory title="">
            <recordset title="">
                <fieldname>Item</fieldname>
                <fieldname>Value</fieldname>
                <datarow>
                    <fieldvalue>System Version</fieldvalue>
                    <fieldvalue>ASUS   - 30303031 Award Medallion BIOS 
v6.0 Award Plug and Play BIOS Extension v1.0A Award Modular BIOS 
v6.0</fieldvalue>
                </datarow>
                <datarow>
                    <fieldvalue>System Date</fieldvalue>
                    <fieldvalue>08/20/02</fieldvalue>
                </datarow>
                <datarow>
                    <fieldvalue>Video Version</fieldvalue>
                    <fieldvalue>ASUS AGP-V7700 VGA BIOS Version 
2.15.01.14 ASUS AGP-V7700 VGA BIOS Version 2.15.01.14 ASUS AGP-V7700 VGA 
BIOS Version 2.15.01.14</fieldvalue>
                </datarow>
                <datarow>
                    <fieldvalue>Video Date</fieldvalue>
                    <fieldvalue>08/17/00</fieldvalue>
                </datarow>
            </recordset>
        </subcategory>
    </category>
    <disclaimer>Names mentioned herein maybe trademarks or service marks 
of their respective holders. Errors and Omissions Excepted. </disclaimer>
</computeraudit>

[-- Attachment #1.2: Type: text/html, Size: 4532 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: XML filtering
  2006-09-03 17:36 XML filtering WN
@ 2006-09-03 17:41 ` Hans Hagen
  2006-09-04  0:54   ` WN
  0 siblings, 1 reply; 3+ messages in thread
From: Hans Hagen @ 2006-09-03 17:41 UTC (permalink / raw)


WN wrote:
> Hello,
>
> I have a couple of XML's generated by a freeware program which I want 
> to process with Context.
> I started experimenting and things look good, however I want to 
> skip/filter out some of the xml tags
> like *<computeraudit> Some Text .... </computeraudit>* and 
> *<disclaimer> Some Text </disclaimer>*
> so they don't show in the resulting PDF.
\defineXMLignore[*computeraudit]*

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: XML filtering
  2006-09-03 17:41 ` Hans Hagen
@ 2006-09-04  0:54   ` WN
  0 siblings, 0 replies; 3+ messages in thread
From: WN @ 2006-09-04  0:54 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 2018 bytes --]

pragma@wxs.nl wrote:
> WN wrote:
>   
Another question, still learning, I am struggling with the following. In 
the XML
there is a tag <recordset> indicating a set of records which I map to 
table entries.
After this tag a couple of tags labelled <fieldname> should be 
translated to table header entries
followed by <datarow> which I map to a table row (\bTR \eTR) but
the tag <fieldname> is not grouped in a <datarow> tag.

How can I translate the <fieldname> tags so they will be interpreted as 
entries in the table header ?

Wim

example XML
<category title="BIOS Version">
        <subcategory title="">
            <recordset title="">
                <fieldname>Item</fieldname>
                <fieldname>Value</fieldname>
                <datarow>
                    <fieldvalue>System Version</fieldvalue>
                    <fieldvalue>ASUS   - 30303031 Award Medallion BIOS 
v6.0 Award Plug and Play BIOS Extension v1.0A Award Modular BIOS 
v6.0</fieldvalue>
            </recordset>
        </subcategory>
    </category>
>> Hello,
>>
>> I have a couple of XML's generated by a freeware program which I want 
>> to process with Context.
>> I started experimenting and things look good, however I want to 
>> skip/filter out some of the xml tags
>> like *<computeraudit> Some Text .... </computeraudit>* and 
>> *<disclaimer> Some Text </disclaimer>*
>> so they don't show in the resulting PDF.
>>     
> \defineXMLignore[*computeraudit]*
>
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                              | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>   


[-- Attachment #1.2: Type: text/html, Size: 3572 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-09-04  0:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-03 17:36 XML filtering WN
2006-09-03 17:41 ` Hans Hagen
2006-09-04  0:54   ` WN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).