पार्स करने के लिए आरएसएस ग्रूवी में फ़ीड की कोशिश में, मैं एक GPath उदाहरण के लिए वाइल्डकार्ड का उपयोग कर पाया:ग्रोवी के जीपीएथ अभिव्यक्तियों का पूर्ण वाक्यविन्यास क्या है?
def text = """
<data>
<common-tables>
<table name="address"/>
<table name="phone"/>
</common-tables>
<special-tables>
<table name="person"/>
</special-tables>
<other-tables>
<table name="business"/>
</other-tables>
</data>
"""
def xml = new XmlParser().parse(new ByteArrayInputStream(text.getBytes()))
def tables = xml.'**'.table.findAll{ it.parent().name() ==
"special-tables" || it.parent().name
(http://old.nabble.com/Q:-Avoiding-XPath---using-GPath-td19087210.html से)
यह फैल-डॉट 'ऑपरेटर की एक अजीब उपयोग की तरह दिखता है। मैं आदि ग्रूवी साइट, पुस्तकों पर इस के लिए किसी भी संदर्भ,
कैसे करता है यह काम, और अधिक महत्वपूर्ण बात, आप इस खोज में नहीं मिल सकता है? क्या वहां GPath 'Rosetta Stone' के लिए कोई XPath है?
उत्कृष्ट, धन्यवाद! मैंने स्रोत को देखने की कोशिश की लेकिन मुझे पता नहीं चलेगा कि कहां देखना है। –