× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



We have the toolkit but I haven't explored it in depth. I've just spent some
time to rewrite some xml used in webservices we have with our headoffice,
but with Namespaces I still had some problems .

What I've seen is that it is not compatible with previous versions as said
in the Readme (different procedure names, different parameters, etc).

==================

The "XML for RPG and Procedural Version 5.0" readme says:

"The XML for Procedural Languages is a service program which provides
interfaces for parsing, generating, manipulating and validating XML
documents. Both DOM level 1 and SAX level 1 APIs are supported as well as
some DOM level 2 and SAX level 2 APIs. In addition, version 4.0.0 added
support for validating documents using XML Schema. This support has been
improved for 5.0.

The XML4C underlying parser is compliant with the XML 1.0 recommendations
and associated standards (DOM 1.0, DOM 2.0, SAX 1.0, SAX 2.0, Namespaces,
and W3C's XML Schema recommendation version 1.0).

Note: XML4PR 5.0 DOM apis are not backward compatible with 4.0.
"




----- Original Message ----- 
From: "Bartell, Aaron L. (TC)" <ALBartell@xxxxxxxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Wednesday, August 11, 2004 4:57 PM
Subject: RE: Question on XML parsing


> Does XML4PR500 have Xpath functionality built in?  I haven't taken the
> time to purchase the toolkit and see what it has for functionality yet.
>
> Aaron Bartell
>
> -----Original Message-----
> From: rpg400-l-bounces@xxxxxxxxxxxx
> [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
> Sent: Wednesday, August 11, 2004 9:24 AM
> To: RPG programming on the AS400 / iSeries
> Subject: Re: Question on XML parsing
>
> With XML4PR500 you can code this (only relevant part):
>
> DBookNum          S             10I 0
> DCatalog          DS                  qualified
> D ID                            10A
>
> DomDoc  = QxmlXercesDOMParser_getDocument(DomParse);
>
> // get number of books
> BookNum = getElemCount('catalog/book':*Omit);
>
> // for each book
> for i = 1 to BookNum;
>   Node = getNode('catalog/book':i-1);
>   Catalog.Id = getAttr(Node:'id');
> endfor;
>
> ===========
> In a service program or inline the main you build your procedures
>
> getElementCount
> returns the count of <book> using
> NodeList = QxmlDOMDocument_getElementsByTagName
>               (DomDoc:ntString:Qxml_CHARSTR:0); ChildNode =
> QxmlDOMNodeList_item(NodeList:0); QxmlDOMNodeList_getLength(NodeList);
>
> getNode
> is similar to getElementCount but returns ChildNode
>
> getAttr
> returns  the attribute of n <book> using AttrNode =
> QxmlDOMElement_getAttribute
>            (Node:ntString:Qxml_CHARSTR:0);
>
>
>
> QxmlDOMDocument_getElementsByTagName
> , getNode and getAttr are procedures
>
>
> ----- Original Message -----
> From: "Jason Botwinick" <jasonbotwinick@xxxxxxxxx>
> To: <rpg400-l@xxxxxxxxxxxx>
> Sent: Wednesday, August 11, 2004 3:30 PM
> Subject: Question on XML parsing
>
>
> >
> > Hi,
> >
> >
> >
> > I am using the XML toolkit for iSeries version 4.00 to parse some
> documents and extract data.
> >
> > I am using the DOM APIs to build the tree structure of the XML and
> then
> extract the data. However I have some problems. The attributes are not
> getting listed as nodes in the tree at all.
> >
> >
> >
> > For example I have the following XML
> >
> > <catalog>
> >
> > <!-- Sample -->
> >
> >             <book id="101">
> >
> >                         <title>Book1</title>
> >
> >                         <author>Author1</author>
> >
> >                         <price>1200</price>
> >
> >             </book>
> >
> >             <book id="102">
> >
> >                         <title>Book2</title>
> >
> >                         <author>Author2</author>
> >
> >                         <price>2400</price>
> >
> >             </book>
> >
> > </catalog>
> >
> >
> >
> > My understanding is that when I list the children of element Node
> 'book',
> there should be a node of type 2 or Qxml_ATTR_NOD. This node should have
> the
> name 'id' and the value '101'. However when I build a nodelist of the
> children for this node using the QxmlDOM_Node_getChildNodes API, and
> then
> see the type for each node separately I do not see any nodes of type 2.
> Is
> my understanding wrong? Can someone help me?
> >
> >
> >
> > Part of the code that I am using is as given below: (its not the full
> code, only the relevant part)
> >
> >
> >
> > C                   EVAL      %str(GETTAGOPT@:256) = '*'
> >
> >  * get a node list of all elements.
> >
> > C                   EVAL      DOMNODELST@ =
> >
> > C                             QxmlDOM_Document_getElementsByTagName
> >
> > C                               (DOMDOC@:GETTAGOPT@:Qxml_CHARSTR:20)
> >
> >  * get number of elements
> >
> > C                   EVAL      WVELEMCNT = QxmlDOM_NodeList_getLength
> >
> > C                                            (DOMNODELST@)
> >
> > C                   IF        WVELEMCNT>0
> >
> > C                   EXCEPT    HDR
> >
> > C                   EVAL      WVCNTR1=0
> >
> > C                   DOW       WVCNTR1<WVELEMCNT
> >
> >  * point to each node separately now.
> >
> > C                   EVAL      SGLNODEPTR@=QxmlDOM_NodeList_item
> >
> > C                                         (DOMNODELST@:WVCNTR1)
> >
> > C                   EVAL      NODETYPE=QxmlDOM_Node_getNodeType
> >
> > C                                      (SGLNODEPTR@)
> >
> > C                   IF        *INOV=*ON
> >
> > C                   EXCEPT    HDR
> >
> > C                   EVAL      *INOV=*OFF
> >
> > C                   ENDIF
> >
> > C                   EXCEPT    ELEMNUM
> >
> > C                   EXCEPT    NODETYP
> >
> >  * find the element name  for this one.
> >
> > C                   EVAL      WVELEMNAM=$FINDNAME(SGLNODEPTR@)
> >
> > C                   EVAL      WVELEMVAL=$NODEVAL(SGLNODEPTR@)
> >
> >  * print the name and value
> >
> > C                   IF        *INOV=*ON
> >
> > C                   EXCEPT    HDR
> >
> > C                   EVAL      *INOV=*OFF
> >
> > C                   ENDIF
> >
> > C                   EXCEPT    NODENAME
> >
> > C                   EXCEPT    NODEVAL
> >
> >  * get a list of children
> >
> > C                   EVAL      CHLNODELST@=QxmlDOM_Node_getChildNodes
> >
> > C                                         (SGLNODEPTR@)
> >
> > C                   EVAL      WVNUMCHL=QxmlDOM_NodeList_getLength
> >
> > C                                      (CHLNODELST@)
> >
> > C                   EVAL      WVCNTR2=0
> >
> > C                   DOW       WVCNTR2<WVNUMCHL
> >
> > C                   EVAL      SGLCHLPTR@=QxmlDOM_NodeList_item
> >
> > C                                        (CHLNODELST@:WVCNTR2)
> >
> > C                   EVAL      NODETYPE=QxmlDOM_Node_getNodeType
> >
> > C                                      (SGLCHLPTR@)
> >
> > C                   EVAL      WVELEMNAM=$FINDNAME(SGLCHLPTR@)
> >
> > C                   EVAL      WVELEMVAL=$NODEVAL(SGLCHLPTR@)
> >
> > C                   IF        *INOV=*ON
> >
> > C                   EXCEPT    HDR
> >
> > C                   EVAL      *INOV=*OFF
> >
> > C                   ENDIF
> >
> > C                   EXCEPT    CHLDNUM
> >
> > C                   EXCEPT    CHLDTYP
> >
> > C                   EXCEPT    CHLDNAME
> >
> > C                   EXCEPT    CHLDVAL
> >
> > C                   EVAL      WVCNTR2=WVCNTR2+1
> >
> > C                   ENDDO
> >
> >  * next element
> >
> > C                   EVAL      WVCNTR1=WVCNTR1+1
> >
> >  *
> >
> > C                   ENDDO
> >
> > C                   ENDIF
> >
> >
> >
> > Procedure $FINDNAME simply returns the output of
> QxmlDOM_Node_getNodeName
> and $NODEVAL returns the output of QxmlDOM_Node_getNodeValue.
> >
> > When I check the nodetype of the children of element node 'book' there
> are
> no nodes of type 2 (attribute node)
> >
> >
> >
> >
> >
> > - Jason
> >
> >
> >
> > ---------------------------------
> > Do you Yahoo!?
> > Yahoo! Mail - 50x more storage than other providers!
> > --
> > This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
> list
> > To post a message email: RPG400-L@xxxxxxxxxxxx
> > To subscribe, unsubscribe, or change list options,
> > visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> > or email: RPG400-L-request@xxxxxxxxxxxx
> > Before posting, please take a moment to review the archives
> > at http://archive.midrange.com/rpg400-l.
> >
>
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
> list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.