XML 보기 좋게 만들기

코드의 들여쓰기와 형식을 정리하며 실행 검증을 대신하지는 않습니다.

입력: 텍스트결과: 텍스트

텍스트 입력

도구 옵션

예제

Read the title and timestamp in an Atom feed

입력

<feed xmlns="http://www.w3.org/2005/Atom"><title>Example Feed</title><updated>2003-12-13T18:30:02Z</updated><entry><title>Atom-Powered Robots Run Amok</title><id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id></entry></feed>

Expected answer

<feed
  xmlns="http://www.w3.org/2005/Atom">
  <title>Example Feed</title>
  <updated>2003-12-13T18:30:02Z</updated>
  <entry>
    <title>Atom-Powered Robots Run Amok</title>
    <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
  </entry>
</feed>
문자열 들여쓰기
Inspect a sitemap containing two public tool URLs

입력

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>https://serialize.dev/tools/from-base64/</loc></url><url><loc>https://serialize.dev/tools/json-beautify/</loc></url></urlset>

Expected answer

<urlset
  xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://serialize.dev/tools/from-base64/</loc>
  </url>
  <url>
    <loc>https://serialize.dev/tools/json-beautify/</loc>
  </url>
</urlset>
문자열 들여쓰기
Separate an SVG circle from its view box

입력

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="#005fcc"/></svg>

Expected answer

<svg
    xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
    <circle cx="50" cy="50" r="40" fill="#005fcc"/>
</svg>
문자열 들여쓰기
Read namespace prefixes in a SOAP envelope

입력

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Body><m:GetPrice xmlns:m="urn:store"><m:ISBN>9780141439518</m:ISBN></m:GetPrice></soap:Body></soap:Envelope>

Expected answer

<soap:Envelope
	xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
	<soap:Body>
		<m:GetPrice
			xmlns:m="urn:store">
			<m:ISBN>9780141439518</m:ISBN>
		</m:GetPrice>
	</soap:Body>
</soap:Envelope>
문자열 들여쓰기
Keep a CDATA expression separate from XML markup

입력

<rule><name>Temperature alert</name><expression><![CDATA[temp < 0 && enabled]]></expression></rule>

Expected answer

<rule>
  <name>Temperature alert</name>
  <expression>
    <![CDATA[temp < 0 && enabled]]>
  </expression>
</rule>
문자열 들여쓰기

매개변수

매개변수기본값입력 및 선택 항목
문자열 들여쓰기"\\t"\n, \r, \t 등의 이스케이프 시퀀스 지원

관련 도구

코드 정리

작업 참고 자료

원본 기술 문서 보기 (English)