Thank you very much, Aleksey, that's something I never would have thought of ...
By the way, googling "self::node" I found that using "." seems to be an equivalent, and it works in my case at least.
In any case, thank you very much
>
>CLEAR
>CLOSE DATABASES all
>
>TEXT TO cXML1 NOSHOW
><?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
><Total>
> <Line type="Subtotal" name="Subtotal">229.99</Line>
> <Line type="Coupon" name="Coupon discount (fallshow)">-23.00</Line>
> <Line type="Subtotal" name="Subtotal">206.99</Line>
> <Line type="Shipping" name="Shipping">29.14</Line>
> <Line type="Tax" name="Tax">0.00</Line>
> <Line type="Total" name="Total">236.13</Line>
></Total>
>ENDTEXT
>
>oTable = SetupXMLTable( "Line", "Line")
>AddXMLField( oTable, "self::node()", "line", "C", 40)
>AddXMLField( oTable, "@name", "_name", "C", 40)
>AddXMLField( oTable, "@type", "_type", "C", 10)
>
>LOCAL oXA as XMLAdapter
>oXA = CREATEOBJECT("XMLAdapter")
>
>oXA.LoadXML(cXML1)
>oXA.Tables.Add(oTable, oTable.XMLName)
>
>oTable.ToCursor()
>SELECT Line
>LIST
>
>Procedure SetupXMLTable( lcName, lcAlias)
> Local oTable
> oTable = Createobject("XMLTable")
> * all XMLName properties must be Unicode
> oTable.XMLName = Strconv(lcName, 5)
> oTable.XMLNameIsXpath = .T.
> * the cursor's alias
> oTable.Alias = lcAlias
> If Used(lcAlias)
> Use In (lcAlias)
> Endif
> Return oTable
>Endproc
>
>Procedure AddXMLField( oTable, lcXMLName, lcAlias, lcDataType, lnMaxLength, lnFractionDigits)
> Local oField
> oField = Createobject("XMLField")
>
> oField.XMLName = Strconv( lcXMLName, 5)
> oField.XMLNameIsXpath = .T.
> oField.Alias = Evl( lcAlias, lcXMLName)
> oField.DataType = lcDataType
> oField.MaxLength = lnMaxLength
> If Not Empty( lnFractionDigits)
> oField.FractionDigits = lnFractionDigits
> Endif
>
> oTable.Fields.Add(oField, oField.XMLName)
> Return oTable
>Endproc
>
>
>Thanks,
>Aleksey.
Jim Nelson
Newbury Park, CA