Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

How to remove/replace following inline css style from html code in Java -


i have html page in following master reset css included. i'll getting html code string in java, have remove/replace/comment following css code using java. have exclude other inline css styles while removing/replacing below css. tried using stringutils class, not working. how can in java?

<style type="text/css">      @charset "utf-8";     /* css document */     /* ver 1.0 author*/     /* master reset */     a,abbr,acronym,address,applet,b,big,blockquote,body,button,caption,center,cite,code,dd,del,dfn,     dir,div,dl,dt,em,embed,fieldset,font,form,frame,h1,h2,h3,h4,h5,h6,hr,html,i,iframe,img,input,     ins,kbd,label,legend,li,menu,object,ol,option,p,pre,q,s,samp,select,small,span,strike,strong,     sub,sup,table,tbody,td,textarea,tfoot,th,thead,tr,tt,u,ul,var     {background:transparent;border:0;font-family:inherit;font-size:100%;font-style:inherit;     font-weight:inherit;margin:0;outline:0;padding:0;vertical-align:baseline;}      html {font-size:1em;overflow-y:scroll;}     body {background:white;color:black;line-height:1;}      a,ins {text-decoration:none;}     blockquote,q{quotes:none;quotes:"" "";}     blockquote:before,blockquote:after,q:before,q:after {content:"";content:none;}     caption,center,td,th {text-align:left;}     del {text-decoration:line-through;}     dir,menu,ol,ul {list-style:none;}     table {border-collapse:collapse;border-spacing:0;}     textarea {overflow-y:auto;} </style> 

i'd recommend using html parsing library such jsoup this.

with jsoup, can select elements (based on tagname, id etc) using selector. example, remove style elements:

document doc = jsoup.parse(html); elements els = doc.select("style"); for(element e: els){     e.remove(); } 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -