<div> tag not reported by SAX parser.
When I add a component to a global pipeline I am not able to catch events for <div> element.
I am trying to rewrite certain attributes in markup generated by CQ5. For this I created a custom component and added this to a default global pipeline.
When I debug I can see that events are thrown for most of the tags, e.g. <script>, <a>, <body>, but <div> tags are not entering startElement() method.
... import org.apache.cocoon.xml.sax.AbstractSAXPipe; import org.apache.cocoon.xml.sax.AttributesImpl; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.rewriter.Transformer; import org.xml.sax.Attributes; import org.xml.sax.SAXException; public class CustomLinkTransformer extends AbstractSAXPipe implements Transformer{ ... @Override public void startElement(String uri, String loc, String raw, Attributes attributes) throws SAXException { Attributes transformedAttr = attributes; // do some processing } ... }In CustomLinkTransformer I set up a breakpoint on line
Attributes transformedAttr = attributes;
so I can see all of the elements passed to this method. And I am not able to see a single <div>.
Seems like SAX parser is not generating events for div elements.
Any ideas why?