Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Saxパーサーを使用してXHTML文字列を解析し、s1が属性ではなくPCDATAにある場合、文字列(s1)のすべての出現を(s2)に変更する例を探しています。誰かがここに光を当てることができますか....
ありがとう!
あなたはただ実装するでしょう
characters(char[] ch, int start, int length)
ContentHandlerのメソッドであり、s1を探し、s2に置き換えます。
もちろん、これは、コンテンツハンドラーがxmlをストリームに出力していることを前提としています。
説明から、実際にはXMLFilterを使用してxmlストリームを適切に変更する必要があります。