sean_vbulletin3_import13365
New Member
I'm parsing pptx file and got such issue:This is a sample of the source XML:\[code\]<?xml version="1.0" encoding="UTF-8" standalone="yes"?><presentation xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns="http://schemas.openxmlformats.org/presentationml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"> <p:sldMasterIdLst> <p:sldMasterId id="2147483648" r:id="rId2"/> </p:sldMasterIdLst> <p:sldIdLst> <p:sldId id="256" r:id="rId3"/> </p:sldIdLst> <p:sldSz cx="10080625" cy="7559675"/> <p:notesSz cx="7772400" cy="10058400"/></presentation>\[/code\]I need to to get 'r:id' attribute value in sldMasterId tag.\[code\]doc = Nokogiri::XML(path_to_pptx)doc.xpath('presentation/p:sldMasterIdLst/p:sldMasterId').attr('id').valuereturns "2147483648" \[/code\]but I need "rId2" ('r:id' attribute value)I found \[code\]attribute_with_ns(name, namespace)\[/code\] method, but \[code\]doc.xpath('presentation/p:sldMasterIdLst/p:sldMasterId').attribute_with_ns('id', 'r') #returns nil\[/code\]