Documentation ¶
Overview ¶
Package xpath the xpath parser
Index ¶
- type Parser
- func (p Parser) GetElement(_ *plugin.Context, content any, arg string) (string, error)
- func (p Parser) GetElements(_ *plugin.Context, content any, arg string) ([]string, error)
- func (p Parser) GetString(_ *plugin.Context, content any, arg string) (string, error)
- func (p Parser) GetStrings(_ *plugin.Context, content any, arg string) ([]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parser ¶
type Parser struct{}
Parser the xpath parser
func (Parser) GetElement ¶
GetElement gets the element of the content with the given arguments.
content := `<ul><li>1</li><li>2</li></ul>` GetStrings(ctx, content, "//li..") returns "<li>1</li>\n<li>2</li>"
func (Parser) GetElements ¶
GetElements gets the elements of the content with the given arguments.
content := `<ul><li>1</li><li>2</li></ul>` GetStrings(ctx, content, "//li..") returns []string{"<li>1</li>", "<li>2</li>"}
Click to show internal directories.
Click to hide internal directories.