🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.text.xml
Article #482

expression xpath, libxml2 et terminal

#482
From: Une bévue
Date: Fri, 29 Sep 2006 07:04
58 lines
2878 bytes
bon je pense avoir un petit probl�me de syntaxe avec libxml2 et une
expression xpath

j'ai un document xml contenant :

<string>SPHardwareDataType</string>

(juste apr�s /array/dict/key)

si avec le xpath d'oxygen je fais :

//string[text() = 'SPHardwareDataType' 

ok, j'ai une tripot�e de r�ponses par ex :
SystemID: /Users/yvon/work/C/libxml/XPath/system_profile.plist
Endroit: 7:0
Description: /plist[1]/array[1]/dict[1]/string[1] - SPHardwareDataType

<cut />

SystemID: /Users/yvon/work/C/libxml/XPath/system_profile.plist
Endroit: 3759:0
Description: /plist[1]/array[1]/dict[19]/string[2] - SPHardwareDataType


mais si je fais �a au term (en utilisant l'exemple "xpath1.c"
(<http://xmlsoft.org/examples/xpath1.c>) :

~/work/C/libxml/XPath%> ./xpath1 system_profile.plist //string[text() =
'SPHardwareDataType'] > xpath1_string_SPHardwareDataType.txt  
zsh: bad pattern: //string[text

donc l� c'est zsh (mon shell) qui rale, rien � voir avec XPath, donc je
recommence en prot�geant l'expression :

~/work/C/libxml/XPath%> ./xpath1 system_profile.plist "//string[text() =
'SPHardwareDataType']" > xpath1_string_SPHardwareDataType.txt
./xpath1:78: command not found: =

l� c'est xpath qui r�le alors je tente le coup en inversant les "" et
les '' :

~/work/C/libxml/XPath%> ./xpath1 system_profile.plist '//string[text() =
"SPHardwareDataType"]' > xpath1_string_SPHardwareDataType.txt
./xpath1:79: command not found: =

pareil )))


comme je pense que le probl�me se situe entre mon fauteil et mon
�cran...


pourriez-vous m'�clairer ???

-- 
une b�vue
Technical Details
Message-ID: <1hmf4ln.13cmuuxxyx45fN%pere.noel@laponie.com.invalid>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 114f60,717aa9b43e5d8635,start
X-Google-Attributes: gid114f60,public
X-Google-Language: FRENCH,ASCII
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: pere.noel@laponie.com.invalid (Une bévue)
Newsgroups: fr.comp.text.xml
Subject: expression xpath, libxml2 et terminal
Date: Fri, 29 Sep 2006 09:04:32 +0200
Organization: NaN
Lines: 58
Message-ID: <1hmf4ln.13cmuuxxyx45fN%pere.noel@laponie.com.invalid>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: individual.net Q+GQcYQT6yo3T1/PCQAKxAHMJs/ZcF/EnGs+usT6+vVbEfcBpl
X-Orig-Path: pere.noel
X-Face: &pPJZaj=yETTJi[(==kP&`'Q;P^*m-|g$gyxFPnI&&}+;Ul=lZ_p6pQS!\#x]
        U4[^EN"1.E)El1acOX,9T\P2).0&^\5Fg';UzeOPF5\Su)"]oXFO9e=Z*Z4!+/</>A!Z
        GQ"IgmAM7Z%1AC9=w*Z&0:->1#.}/|4:GT1KOLp7CQkIm-ZdRm2RrCbD}|X<[VFA?]gI
        DX68liFMy#}lH<Vi'pewlEDG\>]RIKyk#]pSaJTB_RA7EY%Js^>{o)v#DZS&k#zv|Nsj
        O/aWDf\hl1+iN<IKtS%a?A:\yu;Q{.]fD%ObQgY?{2szAy_U
User-Agent: MacSOUP/F-2.8b2 (Mac OS X version 10.4.7 (PPC))