Joyride Posted December 29, 2006 Report Share Posted December 29, 2006 Ir HTML fails, kura bez standarta HTML tagiem ir ari citi, kuri izskatas sadi: <tag:test>teksts</tag> kur "test" ir taga nosaukums, "teksts" ir taga saturs. Ir jaizlasa visi sie [tagi] ara un jasaglaba struktureti kada masiva, apm. ta: tagname => tagcontent. Lai pec tam es varetu, pec vajadzibas vai nu vispar iznemt so tagu ara no HTML koda, vai ari veikt kaut kadas manipulacijas ar taga saturu. Ka to izdarit, praktiski neko par regex nezinu. Link to comment Share on other sites More sharing options...
Delfins Posted December 29, 2006 Report Share Posted December 29, 2006 (edited) <tag:test> - tas nav HTML preg_match_all( '/\<tag\:([^>]+)\>([^<]+)\<\/tag\>/im', $buffer, $match ) Edited December 29, 2006 by Delfins Link to comment Share on other sites More sharing options...
Joyride Posted December 29, 2006 Author Report Share Posted December 29, 2006 Lielum lielais PALDIES! Vel mazins lugums - ka var sameklet atlikusas specialo tagu dalas (ja tadas ir), piemeram, tikai <tag:test> vai tikai </tag>? Link to comment Share on other sites More sharing options...
Delfins Posted December 29, 2006 Report Share Posted December 29, 2006 sāc studēt regexp, dzert jodu un kustināt smadzenes. Piemērs tev ir, ar to pilnīgi pietiek lai sāktu to darīt. Link to comment Share on other sites More sharing options...
4e4en Posted December 30, 2006 Report Share Posted December 30, 2006 un pēc idejas tas ko tu devi, ir pilnīgi garām.. drīzāk vajadzētu būt: <tag:test>teksts</tag:test> Link to comment Share on other sites More sharing options...
andrisp Posted December 30, 2006 Report Share Posted December 30, 2006 Vai tiešām ? Tad kāpēc nav šādi ?: <div id="test"></div id="test"> Link to comment Share on other sites More sharing options...
4e4en Posted December 30, 2006 Report Share Posted December 30, 2006 nezinu, man tas <tag:test>teksts</tag:test> ir no asp valodas :) Link to comment Share on other sites More sharing options...
v3rb0 Posted December 30, 2006 Report Share Posted December 30, 2006 (edited) <tag:test> jau drīzāk pēc xml namespaces izskatās nevis asp. a tādu xmlu uztaisīt var ar jebkura porgramēšanas valodu. Edited December 30, 2006 by v3rb0 Link to comment Share on other sites More sharing options...
Recommended Posts