| XML :: NODEFILTER. XML :: NodeFilter´Â ÀÏ¹Ý XML :: NodeFilter Ŭ·¡½ºÀÔ´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
XML :: NODEFILTER. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- Christian Glahn
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~phish/XML-NodeFilter-0.01/NodeFilter.pm
XML :: NODEFILTER. ű×
XML :: NODEFILTER. ¼³¸í
XML :: NodeFilter´Â ÀÏ¹Ý XML :: NODEFILTER Ŭ·¡½ºÀÔ´Ï´Ù. XML :: NodeFilter´Â ÀÏ¹Ý XML :: NODEFILTER Ŭ·¡½ºÀÔ´Ï´Ù. XML :: NODEFILTER¸¦ »ç¿ëÇÕ´Ï´Ù. ³» $ filter = xml :: nodefilter-> new (); $ your_iterator-> set_filter ($ ÇÊÅÍ); "ÇÊÅÍ´Â"ÇÊÅ͸µ "À»ÇÏ´Â ¹æ¹ýÀ» ¾Ë°íÀÖ´Â °´Ã¼ÀÔ´Ï´Ù. NodeIterator ¶Ç´Â TreeWalker°¡ NodeFilter°¡ ÁÖ¾îÁö¸é ´ÙÀ½ ³ëµå¸¦ ¸®ÅÏÇϱâ Àü¿¡ ÇÊÅ͸¦ Àû¿ëÇÕ´Ï´Ù. ÇÊÅÍ°¡ ³ëµå¸¦ ¼ö¶ôÇÏ·Á¸é ¼øȸ ³í¸®°¡À̸¦ ¹ÝȯÇÕ´Ï´Ù. ±×·¸Áö ¾ÊÀ¸¸é ´ÙÀ½ ³ëµå¸¦ ã¾Æ ³ëµå°¡ °ÅºÎ µÈ °Íó·³ ôÇÕ´Ï´Ù. "ÀÌ Á¤ÀÇ´Â DOM ÀÌ¼Û ¹× ¹üÀ§ »ç¾ç¿¡ ÀÇÇØ Á¦°øµË´Ï´Ù. ÀÌ Å¬·¡½º´ÂÀÌ Å¬·¡½º°¡ ¹«¾ùÀÎÁö ¼³¸íÇÕ´Ï´Ù. A XML :: NodeFilter´Â XML :: libxml :: iterator°¡ ÇϳªÀÇ ³ëµå°¡ È£ÃâÀÚ¿¡°Ô ¹ÝȯµÇ¾î¾ßÇÏ´ÂÁö ¿©ºÎ¸¦ ¾Ë·ÁÁÝ´Ï´Ù. although ¿©±â¼ XML :: libxml¿¡¼¸¸ ¾Ë¸², XML :: NodeFilter´Â ´õ ¿·Á ÀÖÀ¸¹Ç·Î ´Ù¸¥ DOM ±¸Çö°ú ÇÔ²² »ç¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ) ³ëµå ÇÊÅÍÀÇ °æ¿ì. XML :: NodeFilter ±¸ÇöÀº ÇÊÅÍ À¯ÇüÀÌ Ç¥½ÃµÇ¾î¾ßÇÏ´Â ÇÊÅÍ ÀÛ¾÷À̸ç XML :: NodeFilter´Â µÎ °³ÀÇ »ó¼ö¸¦ Ãß°¡ÇÏ´Â ÇÊÅÍ ÀÛ¾÷À̶ó°í »ý°¢Çϱ⠶§¹®¿¡ Ŭ·¡½º Á¤ÀÇ¿¡ whater-yo_show () ÇÔ¼ö¸¦ Ãß°¡ÇÕ´Ï´Ù. »ç¾çÀÇ ÀϺΰ¡ ¾Æ´Õ´Ï´Ù. ù ¹ø°´Â filter_declinedÀÔ´Ï´Ù. ³ëµå°¡ Ç¥½ÃµÇ¾î¾ßÇÏ´ÂÁö ¿©ºÎ¸¦ °áÁ¤Çϱâ À§ÇØ Æ®·¡¹ö·² ·ÎÁ÷À» ¾Ë·ÁÁÝ´Ï´Ù. »ç¾çÀº Æ®·¡¹ö·² ·ÎÁ÷ÀÌ ÇϳªÀÇ ÇÊÅÍ°¡ Àû¿ëµÇÁö ¾Êµµ·Ï Åë°ú ³í¸® ¸¸ Á¤ÀÇÇÏÁö¸¸ ÇÊÅÍ°¡ ´õ ¸¹Àº ÇÊÅ͸¦ »ç¿ëÇÒ ¼öÀÖ´Â °æ¿ì Ŭ¸®³Ê ÄÚµå·Î À̾îÁö´Â °ÍÀ¸·Î ³ªÅ¸³µ½À´Ï´Ù. Traversal LogicÀÌ filter_declined¸¦ ¹ÝȯÇÏ´Â ´ÜÀÏ ÇÊÅ͸¦ ãÀ¸¸é Filter_AcceptÀÇ µ¿ÀǾî·Î ó¸®ÇؾßÇÕ´Ï´Ù. filter_accept°¡ À¯ÇÑÇÏ°í ´Ù¸¥ ¸ðµç ½ÇÇàÀÌ ½ÇÇàµÇÁö ¾ÊÀ¸¸é filter_declined´Â ÇϳªÀÇ À¯¿¬¼ºÀ» Á¦°øÇÕ´Ï´Ù. »ç¾çÀÇ µÎ ¹ø° È®ÀåÀº show_none ±âÈ£ÀÔ´Ï´Ù. ÀÛµ¿ ¿Ï·á¸¦ À§ÇØ Ãß°¡µÇ¾úÀ¸¹Ç·Î ³ëµå À¯Çü ÇÊÅ͸¦ ¸í½Ã ÀûÀ¸·Î ¸í½Ã ÀûÀ¸·Î Àüȯ ÇÒ ¼ö ÀÖ½À´Ï´Ù (¸ðµç ³ëµå À¯ÇüÀÌ °ÅºÎµÇ´Â °ÍÀ» ÀǹÌÇÕ´Ï´Ù). ÀÌ·Î ÀÎÇØ WHAT_TO_ShowÀÇ µÎ ÅëÈ°¡ ´Ù¸¥ °á°ú°¡ ÀÖ½À´Ï´Ù. $ filter-> what_to_show (Undef); # show_all $ filter-> what_to_show (show_none)¸¦ ¼³Á¤ÇÕ´Ï´Ù. # show_allinfact show_noneÀ» ¼³Á¤ÇÏÁö ¾Ê½À´Ï´Ù. null Ç÷¡±×´Â º¯°æÇÏÁö ¾Ê°í Ç÷¡±× ¸ñ·Ï¿¡ Ãß°¡ ÇÒ ¼ö ÀÖÀ½À» ÀǹÌÇÕ´Ï´Ù. $ filter-> what _to_show (show_element | show_text | show_none); µû¶ó¼ $ filter-> what_to_show (show_element | show_text)¿Í µ¿ÀÏÇÕ´Ï´Ù. show_noneÀº ÀÌ·¯ÇÑ Ç÷¡±× ¸ñ·ÏÀ» µ¿ÀûÀ¸·Î ºôµåÇÏ´Â µ¿¾È ¼ýÀÚ ¶Ç´Â ´õ Ãß¾ÇÇÑ ºñ ²÷ÀÓ¾ø´Â °ªÀ» ÇÇÇϱâ À§ÇØ espacally À¯¿ëÇÕ´Ï´Ù. ¿ä±¸ »çÇ× : ¡¤ Perl.
XML :: NODEFILTER. °ü·Ã ¼ÒÇÁÆ®¿þ¾î