from .XmlTag import XmlTag

class WebScript (XmlTag):

	def __init__(self, content_type : str, **kwargs):
		XmlTag.__init__(self, 'script')

		self.add_attribute('type', content_type)
		self.content_type = content_type

		if "content" in kwargs:
			self.targetUrl = None
			self.set_content(kwargs["content"])
		elif "targetUrl" in kwargs:
			self.targetUrl = kwargs["targetUrl"]
			self.add_attribute('src', targetUrl)

	def get_content_type(self):
		return self.content_type
	def get_target_url(self):
		return self.targetUrl
