AltME groups: search
Help · search scripts · search articles · search mailing listresults summary
world | hits |
r4wp | 18 |
r3wp | 648 |
total: | 666 |
results window for this page: [start: 201 end: 300]
world-name: r3wp
Group: XML ... xml related conversations [web-public] | ||
Pekr: 4-Nov-2008 | wait a bit, I'll find it - it was cool stuff from XML REBOL guru. That person used it for his work ... | |
Graham: 4-Nov-2008 | Gavin Mckenzie was the guy who wrote a xml parser | |
Pekr: 4-Nov-2008 | http://www.rebol.org/view-script.r?script=xml-object.r | |
PeterWood: 4-Nov-2008 | obj-xml: make object! xml-to-object parse-xml+ read %my.xml | |
Pekr: 4-Nov-2008 | IIRC we discussed ability to creat XML back from the object, but such script was not written. Maybe it is not even possible, as rebol block as well as created object might not contain original xml tags info ... | |
Pekr: 4-Nov-2008 | Peter - what tools are you referring to? What is xml-to-object and parse-xml+? | |
Graham: 4-Nov-2008 | >> do %xml-parse.r Script: "A more XML 1.0 compliant set of XML parsing tools." (2-Mar-2005) ** Script Error: Invalid argument: Parses XML code and returns a tree of blocks. This is a more XML 1.0 compliant parse than the... ** Where: throw-on-error ** Near: func [[{ Parses XML code and returns a tree of blocks. This is a more XML 1.0 compliant parse than the built-in ... >> | |
Graham: 4-Nov-2008 | well, just use parse-xml .... | |
Graham: 8-Nov-2008 | So, if we wish to access these, we need to talk XML better .. as generally data is marked up in XML | |
Graham: 8-Nov-2008 | the only difference I can see between POST and SOAP is that the encoding method ... SOAP uses text/xml; | |
Chris: 9-Nov-2008 | The web and soap/http are in a sense REST applications (REST is just WS over HTTP) though both use a limited subset of REST arguments and have to work around as such. The web is limited (by the HTML spec) to the verbs 'get and 'post, and post content types of 'application/x-www-form-urlencoded (default) or 'multipart/form-data (used to upload files). For the most part, the web is RESTful as we usually only want to 'get resources. However, other operations typically violate REST principles, as all other resource actions (create, update, delete) have to squeeze through the get/post/url-encode/multipart pipe. The Rebol HTTP protocol as standard is designed to mimic this and requires patching to move beyond get/post/url-endode (even for multipart) SOAP as I understand it, when using HTTP only uses 'post - the post content contains the actual request. Where it varies from the web (and Rebol HTTP) is the need for the 'text/xml content type. REST itself is limited only by HTTP. It uses theoretically limitless HTTP (v1.1) verbs (though most common patterns use 'get, 'put, 'post and 'delete). It uses any encoding. It uses HTTP headers as parameters (eg. the 'Accept header specifies the desired return type). Therefore, any HTTP protocol designed for REST will accomodate SOAP requests. | |
Chris: 19-Nov-2008 | This is a quickie -- designed to make 'parse-xml output more parseable: http://www.ross-gill.com/r/qxml.r Any thoughts, comments? | |
Chris: 19-Nov-2008 | ; Usage: do http://www.ross-gill.com/r/qxml.r load-xml {<some xml="to">Try</some>} | |
Gregg: 19-Nov-2008 | ** Script Error: pop has no value ** Where: load-xml ** Near: mk: insert mk: back mk | |
Chris: 3-Dec-2008 | >> load-xml {<some xml="to">Try</some>} == [ <some> /xml "to" # "Try" ] ] | |
Chris: 3-Dec-2008 | >> load-xml "<try>This</try>" == [ <try> "This" ] | |
Chris: 3-Dec-2008 | response: context [ status: name: value: none ] example: {<rsp> <status>Good</status> <payload> <value name="one">two</value> </payload> </rsp>} probe make response [ parse load-xml example [ <rsp> into [ <status> set status ["Good" | "Bad"] <payload> into [ <value> into [ /name set name string! # set value string! ] ] ] ] ] | |
Chris: 3-Dec-2008 | Note, this parser is destructive - ie. flattening will only provide an approximation of the original xml string. | |
Chris: 3-Dec-2008 | do http://www.ross-gill.com/r/qdom.r doc: load-dom {<some><xml>to try</xml></some>} values: doc/get-by-tagname <xml> values/1/value = "to try" | |
Chris: 3-Dec-2008 | ; You can still parse the tree too: parse doc/tree [<some> into [<xml> "to try"]] | |
Chris: 4-Dec-2008 | Ok, another revision. This has a few more methods, I may strip them down to read-only, as I don't need to manipulate the object though I left them in for completeness. >> do http://www.ross-gill.com/r/qdom.r connecting to: www.ross-gill.com Script: "QuickDOM" (none) >> doc: load-dom {<some><xml id="foo">to try</xml></some>} >> foo: doc/get-by-id "foo" >> foo/name == <xml> >> foo/value == [ /id "foo" # "to try" ] >> kids: foo/children == [make object! [ name: # value: "to try" tree: [ # "to try" ] position: [ ... >> kids/1/value == "to try" >> doc/tree/<some>/<xml>/(#) == "to try" | |
Graham: 22-Jun-2009 | Has anyone written anything to format/index XML documents? | |
Graham: 22-Jun-2009 | format-xml: func [ xml /local out space prev ][ out: copy "" spacer: copy "" prev: copy </tag> foreach tag load/markup xml [ either tag = find tag "/" [ ; we have a close tag ; reduce the spacer by a tab unless the previous was an open tag either not tag? prev [ ; not a tag remove/part spacer 4 ][ ; is a tag if prev = find prev "/" [ ; last was a closing tag remove/part spacer 4 ] ] ][ either tag? tag [ ; current is tag ; indent only if the prev is not a closing tag if not prev = find prev "/" [ insert/dup spacer " " 4 ] ][ ; is data insert/dup spacer " " 4 ] ] repend out rejoin [ spacer tag newline ] prev: copy tag ] view layout compose [ area (out) 400x400 ] ] obj2xml: func [ obj [object!] out [string!] /local o ][ foreach element next first obj [ repend out [ to-tag element ] either object? o: get in obj element [ obj2xml o out ][ repend out any [ o copy "" ] ] repend out [ to-tag join "/" element ] ] ] | |
Graham: 22-Jun-2009 | I was using rebelxml to construct xml ... but I came across some bugs. So this way of doing it looks easier .... | |
Graham: 23-Jun-2009 | What are people using to construct large XML documents ... of 100s of lines? | |
Maxim: 23-Jun-2009 | a modified version of John's rebXML tools. changed the output structure to allow rebol's path notation to be used to traverse the loaded xml. | |
Maxim: 23-Jun-2009 | I also replaced the use of url for the tag words because they fail when using namespaced xml elements. | |
Maxim: 23-Jun-2009 | cause you have have the same element severall times, which is valid xml, but invalid in contexts. | |
Graham: 23-Jun-2009 | Although the XML I'm dealing with doesn't have duplicate elements. | |
Maxim: 23-Jun-2009 | the most stable engine I built which accepted all xml possibilities ended loading xml like so: [ <element> [<subelement> [#attribute "attr-value" . "subelement content"]]] | |
Maxim: 23-Jun-2009 | the . is assigned the value of the elements. the above would result from the following XML: <element> <subelement attribute="attr-value"> subelement content </subelement> </element> | |
Maxim: 23-Jun-2009 | its just that in my tests, either you can create, read or set some of the datatypes via path notation. so only string based types allow full XML qualification. | |
Graham: 23-Jun-2009 | XML can be case sensitive?? | |
BrianH: 23-Jun-2009 | XML *is* case-sensitive. Your paths can't access multiple subelements of the same type, or embedded text. | |
BrianH: 23-Jun-2009 | I was parsing xhtml and other XML of the like. Subelements of mixed types in order with text between them than mattered. | |
Maxim: 23-Jun-2009 | my engine does support embedded types, but ignored it by default... it was also byte reversible... a loaded xml block loaded through the engine was saved back exactly, byte for byte, checksum proofed. | |
Maxim: 23-Jun-2009 | anyhow... the xml tools I currently have are not yet tested enough to be release ready. | |
Maxim: 23-Jun-2009 | I remeber it also tripping on some of the XML files I gave it... don't remember the problems... but its error handling /recovery was very shaky IIRC. | |
Maxim: 24-Jun-2009 | I usually creat myself a new function which calls make and the object init (wether class or prototype based) if that init needs to create new inner objects, then its responsible for doing so. in your case the make-xml-object could accept an xml string and then call make-xml-object recursively for each element it finds. | |
Maxim: 24-Jun-2009 | does the xml structure change a lot (lists of data, alternative or optional elements, etc) or is it really static? | |
Graham: 24-Jun-2009 | I'm creating the XML from scratch .. and not reading it in. | |
Maxim: 24-Jun-2009 | what I can suggest is that you build your objects like so: xml-attribute: context [ name: "someattr" value: "somevalue" ] xml-tag: context [ name: "FileID" content: [] ; a block of inner xml-tag objects attributes: [] ; a block of xml-attribute names ] then all you do is nest objects in objects, filling them up item by item recursively using DB data. | |
Graham: 24-Jun-2009 | What I need to do is to create the object, create the xml from the object, and then submit it via ssl to the gateway server | |
Sunanda: 24-Jun-2009 | [we're off topic for XML -- please continue in Library if you want more details]. Stored in text files and binary files (which are generally just compressed text files. No database! | |
Graham: 28-Jun-2009 | has anyone got a working copy of parse-xml.r from the library? | |
Sunanda: 28-Jun-2009 | Don't remember if I tried parse-xml. I do use xml-object wich works well for me: http://www.rebol.org/view-script.r?script=xml-object.r | |
Sunanda: 28-Jun-2009 | Both parse XML. The main difference is: -- xml-object.r uses REBOL's built-in mezzanine, parse-xml -- parse-xml.r is an improvement for parse-xml In theory, you could use both together. In my experience, xml-object.r is all I need to parse XML ..... the XML I encounter just does not need the extra oomph supplied by parse-xml.r | |
Sunanda: 28-Jun-2009 | This works for me: do %xml-object.r xml-file: read %my-xml-file.xml xml-object: first reduce xml-to-object parse-xml xml-file Though the resulting object does need some tidying up | |
Graham: 28-Jun-2009 | Hmm. There is no 'xml-object function | |
Graham: 28-Jun-2009 | fix-object: func [ obj [object!] /local prev ][ foreach element next first obj [ if object? o: get in obj element [ ; is object, so check to see if has value? either "value?" = form next first o [ set in obj element trim/head/tail get in o 'value? ][ fix-object o ] ] ] ] this fixes up the object created by xml-to-object | |
Graham: 28-Jun-2009 | I've also noticed that xml-to-object has to be run on a copy .... it must alter the original data block it is fed | |
Graham: 28-Jun-2009 | Anyway this is looking promising. I can take an xml message, construct a rebol object from it ... rearrange bits to create a new object and then create a reply xml message. | |
Graham: 29-Jun-2009 | It's an object because xml-to-object creates them that way :( | |
Graham: 5-Jul-2009 | If xml-to-object meets a xml file with a number of elements with the same name, it creates a block of objects. | |
CharlesW: 1-Aug-2009 | Folks, I have gone through this forum with the hopes that I woul''nt bother you with a newb style question. I have been trying all sorts of different xml libraries (rebelxml.r, xml-parse.r, xml-object.r) as well as a few others I found. No matter what I do, I can't seem to pull the values I need. | |
CharlesW: 1-Aug-2009 | Here is the snipped of XMl: <?xml version="1.0"?> <xts:sports-content-set xmlns:xts="http://www.xmlteam.com"query-date-time="20090724T011802-0400" query-string="http://fod.xmlteam.com/api-trial/getDocuments?doc-ids=xt.9140271-box" hostname="fod.xmlteam.com" result-count="1" error-count="0" elapsed-time="64.2ms"><sports-content xmlns:str="java.lang.String" xmlns:dt="http://xsltsl.org/date-time" xmlns:xts="http://www.xmlteam.com"xmlns:exsl="http://exslt.org/common" path-id="baseball/l.mlb.com/event-summary/xt.9140271-box" xts:systemid="MLB_Boxscore_XML" xts:tsnid="9140271"> <sports-metadata xmlns:fs="java.io.File" date-time="20090323T193000-0400" doc-id="xt.9140271-box" xts:tsnslug="AAX%BOX-LOS-ANA" language="en-US" revision-id="l.mlb.com-2009-e.26882-event-stats-sportsnetwork.com" fixture-key="event-stats" document-class="event-summary" fixture-name="Box Score"> <sports-title>Boxscore: LA Angels vs. Los Angeles</sports-title> <sports-content-codes> <sports-content-code code-name="The Sports Network" code-key="sportsnetwork.com" code-type="publisher"/> <sports-content-code code-name="XML Team Solutions, Inc." code-key="xmlteam.com" code-type="distributor"/> <sports-content-code code-type="sport" code-key="15007000" code-name="Baseball"/> <sports-content-code code-type="league" code-key="l.mlb.com" code-name="Major League Baseball"/> <sports-content-code code-type="season-type" code-key="pre-season"/> <sports-content-code code-type="season" code-key="2009"/> <sports-content-code code-type="priority" code-key="normal"/> <sports-content-code code-type="conference" code-key="c.national" code-name="National"/> <sports-content-code code-type="conference" code-key="c.american" code-name="American"/> <sports-content-code code-type="team" code-key="l.mlb.com-t.11" code-name="Los Angeles Angels"/> <sports-content-code code-type="team" code-key="l.mlb.com-t.28" code-name="Los Angeles Dodgers"/> <sports-content-code code-type="action-listing" code-key="complete"/> </sports-content-codes> </sports-metadata> <sports-event xmlns:fs="java.io.File"> <event-metadata xmlns:xte="www.xmlteam.com/xte" date-coverage-type="event" event-key="l.mlb.com-2009-e.26882" date-coverage-value="l.mlb.com-2009-e.26882" event-status="post-event" duration="2:58" start-date-time="20090323T160500-0400" xts:game-of-day="1"> <sports-content-codes/> <event-metadata-baseball/> <site> <site-metadata> <home-location/> </site-metadata> <site-stats attendance="8704"/> </site> </event-metadata> <team> <team-metadata team-key="l.mlb.com-t.28" alignment="away"> <name first="Los Angeles" last="Dodgers"/> </team-metadata> <team-stats score="4" score-opposing="10" event-outcome="loss"> <sub-score period-value="1" score="1"/> <sub-score period-value="2" score="0"/> <sub-score period-value="3" score="0"/> <sub-score period-value="4" score="3"/> <sub-score period-value="5" score="0"/> <sub-score period-value="6" score="0"/> <sub-score period-value="7" score="0"/> <sub-score period-value="8" score="0"/> <sub-score period-value="9" score="0"/> <team-stats-baseball> <stats-baseball-offensive runs-scored="4" at-bats="36" hits="9" rbi="4" bases-on-balls="2" strikeouts="4" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="1" stolen-bases="1" stolen-bases-caught="1" hit-by-pitch="0" left-on-base="7"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> <stats-baseball-pitching runs-allowed="10" hits="13" earned-runs="10" bases-on-balls="6" strikeouts="8" era="10.000" balks="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" shutouts="0" games-complete="0" wins="0" losses="1"/> </team-stats-baseball> </team-stats> <player id="b.11965"> <player-metadata position-event="8" player-key="l.mlb.com-p.11965" status="starter"> <name first="Matt" last="Kemp"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="4" hits="1" rbi="2" bases-on-balls="0" strikeouts="0" singles="1" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="1" hit-by-pitch="0" average=".271"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> | |
CharlesW: 1-Aug-2009 | Using rebelxml.r I have tried: get-xml-data/content/with-attribute 'xts:sports-content-set/sports-content/sports-metadata/sports-content-codes '/sports-content-code/code-type "sport" and many variations of this statement. Using: obj-xml I have tried variations of obj-xml/document/xts-sports-content-set/sports-content/sports-metadata/sports-content-codes/sports-content-code/value? As an example I tried to pull out the league information but could not, However I was able to pull out the TITLE using obj-xml/document/xts-sports-content-set/sports-content/sports-metadata/ sports-title/value? Obviously, I am clueless, so if anyone can point me in the right direction for a well document library (Hopefully with examples) that would be great. Otherwise if there is something glaring that I am doing wrong, please let me know. Thanks, Charlie | |
Graham: 1-Aug-2009 | Rebol's open source xml parsers are not fully complete. Where is the full XML file that the fragment comes from? | |
CharlesW: 1-Aug-2009 | I<?xml version="1.0"?> <xts:sports-content-set xmlns:xts="http://www.xmlteam.com"query-date-time="20090724T011802-0400" query-string="http://fod.xmlteam.com/api-trial/getDocuments?doc-ids=xt.9140271-box" hostname="fod.xmlteam.com" result-count="1" error-count="0" elapsed-time="64.2ms"><sports-content xmlns:str="java.lang.String" xmlns:dt="http://xsltsl.org/date-time" xmlns:xts="http://www.xmlteam.com"xmlns:exsl="http://exslt.org/common" path-id="baseball/l.mlb.com/event-summary/xt.9140271-box" xts:systemid="MLB_Boxscore_XML" xts:tsnid="9140271"> <sports-metadata xmlns:fs="java.io.File" date-time="20090323T193000-0400" doc-id="xt.9140271-box" xts:tsnslug="AAX%BOX-LOS-ANA" language="en-US" revision-id="l.mlb.com-2009-e.26882-event-stats-sportsnetwork.com" fixture-key="event-stats" document-class="event-summary" fixture-name="Box Score"> <sports-title>Boxscore: LA Angels vs. Los Angeles</sports-title> <sports-content-codes> <sports-content-code code-name="The Sports Network" code-key="sportsnetwork.com" code-type="publisher"/> <sports-content-code code-name="XML Team Solutions, Inc." code-key="xmlteam.com" code-type="distributor"/> <sports-content-code code-type="sport" code-key="15007000" code-name="Baseball"/> <sports-content-code code-type="league" code-key="l.mlb.com" code-name="Major League Baseball"/> <sports-content-code code-type="season-type" code-key="pre-season"/> <sports-content-code code-type="season" code-key="2009"/> <sports-content-code code-type="priority" code-key="normal"/> <sports-content-code code-type="conference" code-key="c.national" code-name="National"/> <sports-content-code code-type="conference" code-key="c.american" code-name="American"/> <sports-content-code code-type="team" code-key="l.mlb.com-t.11" code-name="Los Angeles Angels"/> <sports-content-code code-type="team" code-key="l.mlb.com-t.28" code-name="Los Angeles Dodgers"/> <sports-content-code code-type="action-listing" code-key="complete"/> </sports-content-codes> </sports-metadata> <sports-event xmlns:fs="java.io.File"> <event-metadata xmlns:xte="www.xmlteam.com/xte" date-coverage-type="event" event-key="l.mlb.com-2009-e.26882" date-coverage-value="l.mlb.com-2009-e.26882" event-status="post-event" duration="2:58" start-date-time="20090323T160500-0400" xts:game-of-day="1"> <sports-content-codes/> <event-metadata-baseball/> <site> <site-metadata> <home-location/> </site-metadata> <site-stats attendance="8704"/> </site> </event-metadata> <team> <team-metadata team-key="l.mlb.com-t.28" alignment="away"> <name first="Los Angeles" last="Dodgers"/> </team-metadata> <team-stats score="4" score-opposing="10" event-outcome="loss"> <sub-score period-value="1" score="1"/> <sub-score period-value="2" score="0"/> <sub-score period-value="3" score="0"/> <sub-score period-value="4" score="3"/> <sub-score period-value="5" score="0"/> <sub-score period-value="6" score="0"/> <sub-score period-value="7" score="0"/> <sub-score period-value="8" score="0"/> <sub-score period-value="9" score="0"/> <team-stats-baseball> <stats-baseball-offensive runs-scored="4" at-bats="36" hits="9" rbi="4" bases-on-balls="2" strikeouts="4" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="1" stolen-bases="1" stolen-bases-caught="1" hit-by-pitch="0" left-on-base="7"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> <stats-baseball-pitching runs-allowed="10" hits="13" earned-runs="10" bases-on-balls="6" strikeouts="8" era="10.000" balks="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" shutouts="0" games-complete="0" wins="0" losses="1"/> </team-stats-baseball> </team-stats> <player id="b.11965"> <player-metadata position-event="8" player-key="l.mlb.com-p.11965" status="starter"> <name first="Matt" last="Kemp"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="4" hits="1" rbi="2" bases-on-balls="0" strikeouts="0" singles="1" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="1" hit-by-pitch="0" average=".271"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.7103"> <player-metadata position-event="8" player-key="l.mlb.com-p.7103" status="bench"> <name first="Jason" last="Repko"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="1" hits="0" rbi="0" bases-on-balls="0" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".219"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.9917"> <player-metadata position-event="9" player-key="l.mlb.com-p.9917" status="starter"> <name first="Andre" last="Ethier"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="3" hits="2" rbi="0" bases-on-balls="1" strikeouts="0" singles="2" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".204"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.6892"> <player-metadata position-event="pr,7" player-key="l.mlb.com-p.6892" status="bench"> <name first="John-Ford" last="Griffin"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="1" hits="0" rbi="0" bases-on-balls="0" strikeouts="1" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".000"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.3810"> <player-metadata position-event="dh" player-key="l.mlb.com-p.3810" status="starter"> <name first="Manny" last="Ramirez"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="3" hits="0" rbi="0" bases-on-balls="0" strikeouts="2" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="1" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".200"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.9776"> <player-metadata position-event="ph,dh" player-key="l.mlb.com-p.9776" status="bench"> <name first="A.J." last="Ellis"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="1" hits="1" rbi="0" bases-on-balls="0" strikeouts="0" singles="1" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".320"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.6773"> <player-metadata position-event="3" player-key="l.mlb.com-p.6773" status="starter"> <name first="James" last="Loney"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="4" hits="1" rbi="0" bases-on-balls="0" strikeouts="0" singles="1" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".241"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.5664"> <player-metadata position-event="3" player-key="l.mlb.com-p.5664" status="bench"> <name first="Doug" last="Mientkiewicz"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="0" hits="0" rbi="0" bases-on-balls="0" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".238"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.13237"> <player-metadata position-event="2" player-key="l.mlb.com-p.13237" status="starter"> <name first="Russell" last="Martin"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="3" hits="2" rbi="1" bases-on-balls="0" strikeouts="0" singles="2" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="1" stolen-bases-caught="0" hit-by-pitch="0" average=".394"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.7897"> <player-metadata position-event="2" player-key="l.mlb.com-p.7897" status="bench"> <name first="Danny" last="Ardoin"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="1" hits="0" rbi="0" bases-on-balls="0" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".375"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.2687"> <player-metadata position-event="5" player-key="l.mlb.com-p.2687" status="starter"> <name first="Mark" last="Loretta"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="2" hits="0" rbi="0" bases-on-balls="0" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".250"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.14163"> <player-metadata position-event="5" player-key="l.mlb.com-p.14163" status="bench"> <name first="Luis" last="Maza"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="2" hits="1" rbi="0" bases-on-balls="0" strikeouts="0" singles="1" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".100"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.17507"> <player-metadata position-event="4" player-key="l.mlb.com-p.17507" status="starter"> <name first="Blake" last="DeWitt"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="2" hits="0" rbi="0" bases-on-balls="0" strikeouts="1" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".288"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.1347"> <player-metadata position-event="4" player-key="l.mlb.com-p.1347" status="bench"> <name first="Juan" last="Castro"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="2" hits="0" rbi="0" bases-on-balls="0" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".436"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.14313"> <player-metadata position-event="7,9" player-key="l.mlb.com-p.14313" status="starter"> <name first="Xavier" last="Paul"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="3" hits="0" rbi="0" bases-on-balls="1" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".383"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.18742"> <player-metadata position-event="6" player-key="l.mlb.com-p.18742" status="starter"> <name first="Chin-Lung" last="Hu"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="4" hits="1" rbi="1" bases-on-balls="0" strikeouts="0" singles="1" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".316"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="p.8512"> <player-metadata position-event="1" player-key="l.mlb.com-p.8512" status="starter"> <name first="Chad" last="Billingsley"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-pitching runs-allowed="4" innings-pitched="2" hits="4" earned-runs="4" bases-on-balls="3" strikeouts="2" era="6.35" balks="0" shutouts="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" wins="0" losses="0" saves-blown="0" saves="0" xts:wins-season="1" xts:losses-season="1" xts:saves-season="0" xts:saves-blown-season="0"/> </player-stats-baseball> </player-stats> </player> <player id="p.5381"> <player-metadata position-event="1" player-key="l.mlb.com-p.5381" status="bench"> <name first="Jeff" last="Weaver"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-pitching runs-allowed="2" innings-pitched="2" hits="3" earned-runs="2" bases-on-balls="0" strikeouts="2" era="7.88" balks="0" shutouts="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" wins="0" losses="1" saves-blown="0" saves="0" event-credit="loss" xts:wins-season="0" xts:losses-season="1" xts:saves-season="0" xts:saves-blown-season="0"/> </player-stats-baseball> </player-stats> </player> <player id="p.18258"> <player-metadata position-event="1" player-key="l.mlb.com-p.18258" status="bench"> <name first="Scott" last="Elbert"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-pitching runs-allowed="0" innings-pitched="1" hits="1" earned-runs="0" bases-on-balls="0" strikeouts="1" era="6.14" balks="0" shutouts="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" wins="0" losses="0" saves-blown="0" saves="0" xts:wins-season="1" xts:losses-season="0" xts:saves-season="0" xts:saves-blown-season="0"/> </player-stats-baseball> </player-stats> </player> <player id="p.7482"> <player-metadata position-event="1" player-key="l.mlb.com-p.7482" status="bench"> <name first="Erick" last="Threets"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-pitching runs-allowed="2" innings-pitched="1" hits="1" earned-runs="2" bases-on-balls="1" strikeouts="2" era="5.40" balks="0" shutouts="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" wins="0" losses="0" saves-blown="0" saves="0" xts:wins-season="0" xts:losses-season="0" xts:saves-season="0" xts:saves-blown-season="0"/> </player-stats-baseball> </player-stats> </player> <player id="p.19392"> <player-metadata position-event="1" player-key="l.mlb.com-p.19392" status="bench"> <name first="Ramon" last="Troncoso"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-pitching runs-allowed="2" innings-pitched="1" hits="3" earned-runs="2" bases-on-balls="1" strikeouts="0" era="7.88" balks="0" shutouts="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" wins="0" losses="0" saves-blown="0" saves="0" xts:wins-season="0" xts:losses-season="1" xts:saves-season="1" xts:saves-blown-season="0"/> </player-stats-baseball> </player-stats> </player> <player id="p.14165"> <player-metadata position-event="1" player-key="l.mlb.com-p.14165" status="finished"> <name first="Brian" last="Mazone"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-pitching runs-allowed="0" innings-pitched="1" hits="1" earned-runs="0" bases-on-balls="1" strikeouts="1" era="0.00" balks="0" shutouts="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" wins="0" losses="0" saves-blown="0" saves="0" xts:wins-season="0" xts:losses-season="0" xts:saves-season="1" xts:saves-blown-season="0"/> </player-stats-baseball> </player-stats> </player> </team> <team> <team-metadata team-key="l.mlb.com-t.11" alignment="home"> <name first="Los Angeles" last="Angels"/> </team-metadata> <team-stats score="10" score-opposing="4" event-outcome="win"> <sub-score period-value="1" score="2"/> <sub-score period-value="2" score="2"/> <sub-score period-value="3" score="0"/> <sub-score period-value="4" score="2"/> <sub-score period-value="5" score="0"/> <sub-score period-value="6" score="2"/> <sub-score period-value="7" score="2"/> <sub-score period-value="8" score="0"/> <sub-score period-value="9"/> <team-stats-baseball> <stats-baseball-offensive runs-scored="10" at-bats="34" hits="13" rbi="10" bases-on-balls="6" strikeouts="8" doubles="2" triples="1" home-runs="3" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="1" stolen-bases="0" stolen-bases-caught="2" hit-by-pitch="0" left-on-base="6"/> <stats-baseball-defensive errors="3" errors-passed-ball="0"/> <stats-baseball-pitching runs-allowed="4" hits="9" earned-runs="3" bases-on-balls="2" strikeouts="4" era="3.000" balks="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" shutouts="0" games-complete="0" wins="1" losses="0"/> </team-stats-baseball> </team-stats> <player id="b.6445"> <player-metadata position-event="5" player-key="l.mlb.com-p.6445" status="starter"> <name first="Chone" last="Figgins"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="2" hits="1" rbi="1" bases-on-balls="1" strikeouts="0" singles="1" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="2" hit-by-pitch="0" average=".325"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.20376"> <player-metadata position-event="ph,8" player-key="l.mlb.com-p.20376" status="bench"> <name first="Coby" last="Smith"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="2" hits="1" rbi="0" bases-on-balls="0" strikeouts="1" singles="1" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".667"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.11967"> <player-metadata position-event="4" player-key="l.mlb.com-p.11967" status="starter"> <name first="Howie" last="Kendrick"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="2" hits="0" rbi="0" bases-on-balls="1" strikeouts="2" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".344"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.7011"> <player-metadata position-event="ph,2" player-key="l.mlb.com-p.7011" status="bench"> <name first="Ryan" last="Budde"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="1" hits="0" rbi="0" bases-on-balls="1" strikeouts="1" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".412"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.5533"> <player-metadata position-event="7" player-key="l.mlb.com-p.5533" status="starter"> <name first="Bobby" last="Abreu"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="2" hits="0" rbi="0" bases-on-balls="1" strikeouts="2" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".263"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.11570"> <player-metadata position-event="5" player-key="l.mlb.com-p.11570" status="bench"> <name first="Brandon" last="Wood"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="2" hits="1" rbi="0" bases-on-balls="0" strikeouts="0" singles="1" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="1" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".354"/> <stats-baseball-defensive errors="1" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.1946"> <player-metadata position-event="9" player-key="l.mlb.com-p.1946" status="starter"> <name first="Vladimir" last="Guerrero"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="3" hits="2" rbi="0" bases-on-balls="0" strikeouts="0" singles="2" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".250"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.19314"> <player-metadata position-event="9" player-key="l.mlb.com-p.19314" status="bench"> <name first="Chris" last="Pettit"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="2" hits="1" rbi="0" bases-on-balls="0" strikeouts="1" singles="1" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".354"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.2062"> <player-metadata position-event="8" player-key="l.mlb.com-p.2062" status="starter"> <name first="Torii" last="Hunter"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="3" hits="1" rbi="2" bases-on-balls="0" strikeouts="0" singles="0" doubles="0" triples="1" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".182"/> <stats-baseball-defensive errors="1" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.15871"> <player-metadata position-event="4" player-key="l.mlb.com-p.15871" status="bench"> <name first="Sean" last="Rodriguez"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="1" hits="0" rbi="0" bases-on-balls="0" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".282"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.18447"> <player-metadata position-event="3" player-key="l.mlb.com-p.18447" status="starter"> <name first="Kendry" last="Morales"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="3" hits="0" rbi="0" bases-on-balls="0" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".367"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.7262"> <player-metadata position-event="3" player-key="l.mlb.com-p.7262" status="bench"> <name first="Matthew" last="Brown"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="1" hits="0" rbi="1" bases-on-balls="0" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".550"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.6012"> <player-metadata position-event="dh" player-key="l.mlb.com-p.6012" status="starter"> <name first="Juan" last="Rivera"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="2" hits="1" rbi="0" bases-on-balls="0" strikeouts="1" singles="0" doubles="1" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".211"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.5647"> <player-metadata position-event="ph,dh" player-key="l.mlb.com-p.5647" status="bench"> <name first="Gary" last="Matthews"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="0" at-bats="1" hits="0" rbi="0" bases-on-balls="1" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".357"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.6928"> <player-metadata position-event="2" player-key="l.mlb.com-p.6928" status="starter"> <name first="Jeff" last="Mathis"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="2" hits="1" rbi="1" bases-on-balls="0" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="1" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".343"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.6814"> <player-metadata position-event="ph,6" player-key="l.mlb.com-p.6814" status="bench"> <name first="Maicer" last="Izturis"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="1" hits="1" rbi="1" bases-on-balls="1" strikeouts="0" singles="1" doubles="0" triples="0" home-runs="0" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".278"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.8016"> <player-metadata position-event="6" player-key="l.mlb.com-p.8016" status="starter"> <name first="Erick" last="Aybar"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="2" at-bats="2" hits="2" rbi="2" bases-on-balls="0" strikeouts="0" singles="0" doubles="1" triples="0" home-runs="1" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".310"/> <stats-baseball-defensive errors="1" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="b.6589"> <player-metadata position-event="ph,7" player-key="l.mlb.com-p.6589" status="bench"> <name first="Robb" last="Quinlan"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-offensive runs-scored="1" at-bats="2" hits="1" rbi="2" bases-on-balls="0" strikeouts="0" singles="0" doubles="0" triples="0" home-runs="1" grand-slams="0" sac-flies="0" sacrifices="0" grounded-into-double-play="0" stolen-bases="0" stolen-bases-caught="0" hit-by-pitch="0" average=".310"/> <stats-baseball-defensive errors="0" errors-passed-ball="0"/> </player-stats-baseball> </player-stats> </player> <player id="p.7092"> <player-metadata position-event="1" player-key="l.mlb.com-p.7092" status="starter"> <name first="Dustin" last="Moseley"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-pitching runs-allowed="4" innings-pitched="6" hits="8" earned-runs="3" bases-on-balls="1" strikeouts="3" era="3.15" balks="0" shutouts="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" wins="1" losses="0" saves-blown="0" saves="0" event-credit="win" xts:wins-season="3" xts:losses-season="0" xts:saves-season="0" xts:saves-blown-season="0"/> </player-stats-baseball> </player-stats> </player> <player id="p.20390"> <player-metadata position-event="1" player-key="l.mlb.com-p.20390" status="bench"> <name first="Trevor" last="Reckling"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-pitching runs-allowed="0" innings-pitched="2" hits="1" earned-runs="0" bases-on-balls="1" strikeouts="0" era="0.00" balks="0" shutouts="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" wins="0" losses="0" saves-blown="0" saves="0" xts:wins-season="0" xts:losses-season="0" xts:saves-season="0" xts:saves-blown-season="0"/> </player-stats-baseball> </player-stats> </player> <player id="p.20370"> <player-metadata position-event="1" player-key="l.mlb.com-p.20370" status="finished"> <name first="Mason" last="Tobin"/> </player-metadata> <player-stats> <player-stats-baseball> <stats-baseball-pitching runs-allowed="0" innings-pitched="1" hits="0" earned-runs="0" bases-on-balls="0" strikeouts="1" era="0.00" balks="0" shutouts="0" errors-wild-pitch="0" number-of-pitches="0" number-of-strikes="0" wins="0" losses="0" saves-blown="0" saves="0" xts:wins-season="0" xts:losses-season="0" xts:saves-season="0" xts:saves-blown-season="0"/> </player-stats-baseball> </player-stats> </player> </team> <officials> <official> <official-metadata position="Home Plate Umpire"> <name full="Jim Wolf"/> </official-metadata> </official> <official> <official-metadata position="First Base Umpire"> <name full="Bob Davidson"/> </official-metadata> </official> <official> <official-metadata position="Second Base Umpire"> <name full="Mike Winters"/> </official-metadata> </official> <official> <official-metadata position="Third Base Umpire"> <name full="Mike Everitt"/> </official-metadata> </official> </officials> <event-actions> <event-actions-baseball/> </event-actions> <highlight class="double-plays"> <p>Los Angeles 2; LA Angels 1.</p> </highlight> </sports-event> </sports-content></xts:sports-content-set> | |
Graham: 2-Aug-2009 | parse-xml and xml-to-object seems to work okay on this file. | |
Graham: 2-Aug-2009 | >> do %xml-parse.r Script: "A more XML 1.0 compliant set of XML parsing tools." (4-Dec-2001) >> do %xml-object.r Script: {Convert an XML-derived block structure into objects.} (29-Sep-2001) >> obj: first reduce xml-to-object parse-xml+ read %test.xml >> data: second obj == [make object! [ xts:sports-content-set: make object! [ sports-content: make object! [ sports... >> type? data == block! >> probe data/2/sports-content/sports-event/team/1/player/1 make object! [ player-metadata: make object! [ name: make object! [ value?: "" first: "Matt" last: "Kemp" ] position-event: "8" player-key: "l.mlb.com-p.11965" status: "starter" ] player-stats: make object! [ player-stats-baseball: make object! [ stats-baseball-offensive: make object! [ value?: "" runs-scored: "0" at-bats: "4" hits: "1" rbi: "2" bases-on-balls: "0" strikeouts: "0" singles: "1" doubles: "0" triples: "0" home-runs: "0" grand-slams: "0" sac-flies: "0" sacrifices: "0" grounded-into-double-play: "0" stolen-bases: "0" stolen-bases-caught: "1" hit-by-pitch: "0" average: ".271" ] stats-baseball-defensive: make object! [ value?: "" errors: "0" errors-passed-ball: "0" ] ] ] id: "b.11965" ] | |
Chris: 12-Aug-2009 | >> do http://www.ross-gill.com/r/altxml.r connecting to: www.ross-gill.com Script: "AltXML" (7-Jun-2009) >> all-stats: load-xml/dom your-xml-data >> player: stats/get-by-id "b.11965" >> his-stats: first player/get-by-tag <stats-baseball-offensive> >> his-stats/get #hits == "1" >> remove-each code codes: all-stats/get-by-tag <sports-content-code> ["league" <> code/get #code-type] == [make object! [ name: <sports-content-code> space: none value: [ #code-type "league" ... >> foreach code codes [probe code/get #code-name] Major ^/ League Baseball == "Major ^/ League Baseball" | |
Chris: 14-Aug-2009 | Doesn't go into much detail, but: http://www.ross-gill.com/page/XML+and+REBOL | |
Graham: 14-Aug-2009 | Given some xml like this which is a list of documents http://code.google.com/apis/documents/docs/2.0/developers_guide_protocol.html#ListDocs how would your parser extract the <gd:resourceid> and text associated with these tags? | |
Chris: 14-Aug-2009 | >> google-xml: load-xml/dom clipboard:// ; copied from page >> entries: google-xml/get-by-tag <entry> == [make object! [ name: <entry> space: none value: [ #etag {"BxAUSh5RAyp7ImBq"} <... >> foreach entry entries [probe entry/get <resourceId>] spreadsheet:key == "spreadsheet:key" | |
Graham: 15-Aug-2009 | Sounds like too much overhead ... unzip the docx, make changes to the xml portion and then rezip. | |
Janko: 2-Jan-2010 | I will need a xml parser .. I was thinkinf something fast and quick like sax style .. I found this one http://www.rebol.org/view-script.r?script=xml-parse.r but by looking of it it seems to offer a lot of things I don't need. Has anyone used it for "serrious" xml parsing with it. I am thinking of making my own simple minimal event based xml parser. | |
Graham: 2-Jan-2010 | Yes, I have used it to parse large XML files | |
Graham: 2-Jan-2010 | You can turn the xml file into a rebol object with it | |
Janko: 2-Jan-2010 | yes, I get a big xml made by "official" BLOATED standard for invoices .. I want to parse it as quick as possible and that's all | |
Robert: 2-Jan-2010 | Wouldn't it make a lot more sense to use a C based XML parser, construct a Rebol data-structure/string and return that to Rebol? | |
Geomol: 2-Jan-2010 | Janko, rebxml is a rebol version of xml. It can do the same things, but without the bad implementation, xml suffers from. The idea behind xml is ok, it's just not implemented well. Much of that is solved with the rebxml format. | |
Gregg: 2-Jan-2010 | I believe Maarten has done a SAX style parser. I've used parse-xml in the past, sometimes post-processing the output to a different REBOL form, but my needs were simple. Janko, have you tested any of the existing soluitions, with test input on target hardware, and found them to be too slow? If so, what were the results, and how fast do you need it to be? | |
Janko: 3-Jan-2010 | Robert: it's a good idea but not for my case. I don't want the data strucure from whole xml , I want to stream it through parser and collect out the data. Geomol: I will look at it but probably not what I want in this particular case for the reason above Gregg: I haven't tested any yet, I googled and found that xml-parse.r above , which has sax style of work but seems huge. I only care to support the simplified subset of xml, xml with all the variants is a total bloat so I believe it can be that complex (and it doesn't support 100% of it also). Thats why I am considering writing a simple sax liek parser, I wrote it in c once and it was small (but it parsed even smaller subset of xml) | |
Dockimbel: 4-Jan-2010 | It's a matter of tradeoff, if you only need fast XML document reading, SAX is the winner. If you need to modify the document, you need DOM (with or without SAX). | |
james_nak: 11-Oct-2010 | Does anyone know if there is a rebol object to xml script. I've got xml to rebol objects but now I want to change it back to xml. (and I'm lazy) | |
Maxim: 12-Oct-2010 | I use blocks, although a bit slower to access, they are faster for big loads cause thery require less ram and do not required binding which is a big issue on large XML blocks. | |
james_nak: 12-Oct-2010 | Yeah, what I am trying to do is convert back to XML after I've done my thing. | |
Maxim: 12-Oct-2010 | well, going to xml is easy no? | |
Oldes: 13-Oct-2010 | It depends what's your input and how should look the output, but you can use something like that: context [ xml: copy "" tabs: copy "" set 'to-xml func[node /init][ if init [ xml: copy "" tabs: copy "" ] switch/default type?/word node [ object! [ append tabs #"^-" foreach child next first node [ append xml rejoin [tabs "<" child ">^/"] to-xml node/(child) append xml rejoin [tabs "</" child ">^/"] ] remove tabs ] ][ append xml rejoin [ tabs "<" type? node ">" node "</" type? node ">^/" ] ] xml ] ] o: context [ person: context [ name: "bla" age: 1 ] ] print rejoin [ "<o>^/" to-xml o "</o>" ] | |
GrahamC: 3-Nov-2010 | Is John's the only rebol utility that turns a rebol representation back into an xml document with attributes? | |
Maxim: 10-Nov-2010 | A question for XML users related to namespaces. is it possible for a tag's attributes to originate from two different namespaces? ex: <tag ns1:attr="data" ns2:other-attr="data"> or even worse: <tag ns1:attr="data" ns2:attr="data"> my gut tells me no, but I've been wrong before in this delightfull world of XML spec overcomplexification . | |
Maxim: 10-Nov-2010 | FYI, I've just discovered that yes... you can have the same attribute several times in a tag so long as the namespace is different. XML is ... so ... much ... fun.... NOT! | |
Gregg: 10-Nov-2010 | I don't like XML, but it makes sense that namespaces prevent collisions. | |
Maxim: 10-Nov-2010 | hehe, yes it is similar to advanced word usage in REBOL. but xml isn't really a language in my understanding (interpretation) of the word. | |
Oldes: 13-Nov-2010 | I just created this function to convert the data tree returned from REBOL's default parse-xml function back to the same string: context [ out: copy "" emitxml: func[dom][ foreach node dom [ either string? node [ out: insert out node ][ foreach [ name atts content ] node [ out: insert out join {<} [name #" "] if atts [ foreach [att val] atts [ out: insert out ajoin [att {="} any [val ""] {" }] ] ] out: remove back out either all [content not empty? content] [ out: insert out #">" emitxml content out: insert out ajoin ["</" name #">"] ][ out: insert out "/>" ] ] ] ] ] set 'xmltree-to-str func[dom][ clear head out emitxml dom head out ] ] | |
Oldes: 13-Nov-2010 | >> xmltree-to-str third parse-xml {<test arg="1"><bla/>hello</test>} == {<test arg="1"><bla/>hello</test>} | |
Oldes: 14-Nov-2010 | do you mean this?: >> print xmltree-to-str third parse-xml {<h:table xmlns:h="http://www.w3.org/TR/html4/"> { <h:tr> { <h:td>Apples</h:td> { <h:td>Bananas</h:td> { </h:tr> { </h:table>} <h:table xmlns:h="http://www.w3.org/TR/html4/"> <h:tr> <h:td>Apples</h:td> <h:td>Bananas</h:td> </h:tr> </h:table> | |
Oldes: 14-Nov-2010 | But REBOL's default parse-xml has limitations, so better use Gavin's http://www.rebol.org/view-script.r?script=xml-parse.rif you must parse some advanced XML doc's. | |
Oldes: 14-Nov-2010 | Just note, that if the source xml is using CDATA, the parsed tree does not contain this info, so the result would be different. >> print xmltree-to-str probe third parse-xml+ {<foo>abc <![CDATA[Jack & Jill]]> xyz</foo> } [["foo" none ["abc Jack & Jill xyz"]]] <foo>abc Jack & Jill xyz</foo> | |
Oldes: 14-Nov-2010 | I'm not sure how to awoid this, but fortunately my XML sources must be well formed without CDATA so I'm safe. | |
Chris: 23-Nov-2010 | Graham, AltXML dom objects have a 'flatten function that renders xml. It preserves namespaces but not whitespace or cdata as cdata (though I may do a strict version that does both). | |
BrianH: 11-Mar-2011 | Finally, the work of the W3C binary XML group is an official recommendation: http://www.w3.org/TR/exi/ | |
Maxim: 2-May-2011 | anyone here had issues with receiving Form feed characters in XML (which are illegal in XML 1.0) ? | |
Group: SQLite ... C library embeddable DB [web-public]. | ||
Claude: 9-Mar-2006 | perhaps include in sqlite a XML ouput would be a good idea ! | |
Ashley: 9-Mar-2006 | /no-copy is a reasonable compromise, and fits with the /flat refinement in that the driver defaults to the expected "safe" behaviour. I'll add that to the next build. XML output: I'm adding HTML output to the next build; is XML needed in addition to that? And if so, what does a "standard" table definition look like under XML (please provide a short example). SQL refinements: the idea is that in most cases you specify all the refinements you need with CONNECT and just use SQL without any; except in the following two special cases: 1. SQL/direct: where you used CONNECT (without the /direct refinement), but need to access a *specific* table that does not need its TEXT column values MOLDed (e.g. sqlite_master) 2. SQL/raw: as above but flattens data. Used primary to access system tables / data, this ensures that values are always returned in a consistent format; lets you write code like: to file! third DATABASE without having to worry about the format of the returned block(s). Grammatical question. Do folks prefer I use the word INDEXES or INDICES to refer to more than one INDEX? | |
Pekr: 10-Mar-2006 | XML makes more sense, but dunno what kind of XML - just columns wrapped in <colname>value</colname>? | |
Group: Postscript ... Emitting Postscript from REBOL [web-public] | ||
Pekr: 5-Apr-2006 | imo this is so big waste of time, it even does not deserve separate group. PS is good for what nowadays? Printers? Who does use it? At least for documents in corporate sphere, thre are only two kinds of docs which will survive imo - PDF, and XML based docs. | |
Pekr: 5-Apr-2006 | James - world is moving away from xls and doc, even MS - "open" XML formats will prevail. As for IBM - they are already internally on ODF format (internal info) | |
james_nak: 5-Apr-2006 | Pekr, this observation is based on my current experience. I have yet to get an XML doc from any IBM'er. |
201 / 666 | 1 | 2 | [3] | 4 | 5 | 6 | 7 |